Giter Club home page Giter Club logo

loading's Introduction

loading

loading... 效果图如下: loading

DEMO请点击这里查看.

http://tianxiangbing.github.io/loading/example/有对loading作一个完美的演示

调用示例

html:

<p>
	<input type="button" id="loading1" value="loading我自己">
	<input type="button" id="loading2" value="loading下面这个div">
	<input type="button" id="loading3" value="loading全屏">
</p>
<div id="loading-content" style="width:300px;height:200px;border:1px solid #ccc;background-color:#f2f2f2;">这是个内容的例子</div>
<script src="../src/jquery-1.11.2.js"></script>
<script src="../src/loading.js"></script>

js:

//loading我自己
$('#loading1').click(function(){
	var load = new Loading();
	load.init({
		target: this
	});
	load.start();
	setTimeout(function() {
		load.stop();
	}, 3000)
});
//loading下面这个div
$('#loading2').click(function(){
	var load = new Loading();
	load.init({
		target: "#loading-content"
	});
	load.start();
	setTimeout(function() {
		load.stop();
	}, 3000)
});
//loading全屏
$('#loading3').click(function(){
	var load = new Loading();
	load.init();
	load.start();
	setTimeout(function() {
		load.stop();
	}, 30000)
});

API

属性

target:string||dom

需要显示loading的节点,不传值时显示全屏的loading

方法

start:function()

开始loading

stop:function()

结束loading,这里会销毁loading节点

事件

stop

target的stop事件触发时,结束loading. 如
$('html').trigger('stop')会结束全屏的loading动画.

loading's People

Contributors

tianxiangbing avatar

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.