手机版

JS中为循序中延迟加载动态效果的具体实现

时间:2021-11-16 来源:互联网 编辑:宝哥软件园 浏览:

复制代码代码如下:脚本src=' http : js/jquery-1。7 .1 .量滴js ' type=' text/JavaScript '/script script type=' text/JavaScript ' $(function(){ for(var I=1;i6;i ) { var a=$('#zhong' i ' ').高度();//获取高度$(' #中I ' ').attr('OldHeight ',a);//设置旧高度属性} var e=0;//定义一个值interid=setInterval(Showgao,30);//setInerval每隔30毫秒加载一次函数秀高(){ e;for(var x=1;X6;x ) { var b=$('#zhong' x ' ').attr('旧高度');if(typeof(b)=='undefined'||b!='') { if(eb){$('#zhong' x ' ').身高(b );} else{$('#zhong' x ' ').高度(e );} } } if(e==1000){ clearInterval(interid);} } });/script再看看超文本标记语言代码复制代码代码如下: div class=' Zhu no1 ' div class=' tou ' img src=' http : images/toubg。png '/div div id=' zhong 1 ' class=' zhong ' style=' height :66 px;/div class=' Wei ' img src=' http : images/weibg。png '/div/div class=' Zhu NO2 ' div class=' tou ' img src=' http : images/toubg。png '/div id=' zhong ' class=' zhong ' style=' height :0 px;/div class=' Wei ' img src=' http : images/weibg。png '/div/div class=' Zhu NO3 ' div class=' tou ' img src=' http : images/toubg。png '/div div id=' zhong ' style=' height 336022 px;/div class=' Wei ' img src=' http : images/weibg。png '/div/div class=' Zhu no4 ' img src=' http : images/huisebg。png '/div实现的效果是这样的,我的意思不知道大家能不能明白,其实就是先定好这个圆柱的高度,然后用射流研究…动态的从0往上升,最好达到设定好的高度

版权声明:JS中为循序中延迟加载动态效果的具体实现是由宝哥软件园云端程序自动收集整理而来。如果本文侵犯了你的权益,请联系本站底部QQ或者邮箱删除。