Coder Social home page Coder Social logo

mailzwj / jquery.bubble Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 2.0 922 KB

一个基于jQuery的气泡动画插件,在指定区域上方(左/右)定时间隔产生气泡,然后随机水平速度进行仿自由落体运动。到达区域底部之后做弹跳运动,速度逐渐衰减。直至停止运动。

CSS 8.56% JavaScript 91.44%

jquery.bubble's Introduction

jquery.bubble

一个基于jQuery的气泡动画插件,在指定区域上方(左/右)定时间隔产生气泡,然后随机水平速度进行仿自由落体运动。到达区域底部之后做弹跳运动,速度逐渐衰减。直至停止运动。

bubble.gif

在线演示

安装方法

由于是基于jQuery的扩展插件,因此引入jQuery是必须的。 此外,还需引入插件自身的实现脚本。

<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="../js/jquery.bubble.min.js"></script>

在此之前,我们还需要引入样式依赖文件jquery.bubble.min.css,主要包含气泡自身基础样式。

<link rel="stylesheet" href="../css/jquery.bubble.min.css">

使用示例

插件会在指定的元素范围内运行,如果找不到指定的元素,插件将以body元素作为容器。

$(function() {
    $('#J_PluginWrap').bubble({
        // 气泡元素Class
        itemClass: 'J_BubbleItem',
        // 气泡大小范围[最小值, 最大值],单位px
        size: [60, 120],
        // 气泡吹大时间范围[最小值, 最大值],单位s
        blowTime: [0.5, 1],
        // 气泡出现的方向,left/right
        direction: 'right',
        // 位置偏移量,[x, y],效果与 direction 相关
        offset: [0, 60],
        // 气泡产生时间间隔,单位s
        interval: 1.2,
        // 自动停止的时间,为0则不停止,单位s
        autoStop: 10
    });
});

更多详细信息,请参看源码

jquery.bubble's People

Contributors

mailzwj avatar

Watchers

 avatar  avatar

Forkers

see-js wgj0913

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.