失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > ajax页面载入动画 添加加载动画 jQuery的AJAX .load()

ajax页面载入动画 添加加载动画 jQuery的AJAX .load()

时间:2021-04-02 03:41:22

相关推荐

ajax页面载入动画 添加加载动画 jQuery的AJAX .load()

对于我知道必须采取超过几毫秒的时间的潜力,我用Spin.js它没有任何外部依赖,并且是跨浏览器兼容

var opts = {

lines: 13, // The number of lines to draw

length: 10, // The length of each line

width: 4, // The line thickness

radius: 11, // The radius of the inner circle

rotate: 0, // The rotation offset

color: '#000', // #rgb or #rrggbb

speed: 0.6, // Rounds per second

trail: 32, // Afterglow percentage

shadow: false, // Whether to render a shadow

hwaccel: false, // Whether to use hardware acceleration

className: 'spinner', // The CSS class to assign to the spinner

zIndex: 2e9, // The z-index (defaults to 2000000000)

top: 'auto', // Top position relative to parent in px

left: 'auto' // Left position relative to parent in px

};

var target, spinner;

$(function(){

target = $('#window').get(0);

spinner = new Spinner(opts);

spinner.spin(target);

setTimeout(function(){

spinner.stop();

$(target).html("Loading finished.");

}, 3500);

});

看到小提琴/y75Tp/73/(更新异步请求感谢verbumSapienti)

如果觉得《ajax页面载入动画 添加加载动画 jQuery的AJAX .load()》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。