|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 |
(function($){$.extend("elasticityMove",function(obj,iTarget){ var
i = 0; for(i = 0; i < this.elements.length; i++){ startMove(obj,iTarget); } }); var
iSpeed = 0;var
left = 0;function
startMove(obj,iTarget){ clearInterval(obj.timer); obj.timer = setInterval(function(){ iSpeed += (iTarget - obj.offsetLeft) / 5;// iSpeed *= 0.7; left += iSpeed; if(Math.abs(iSpeed) < 1 && Math.abs(left - iTarget) < 1){ clearInterval(obj.timer); obj.style.left = iTarget + "px"; } obj.style.left = left + "px"; },30);}})($())<br><br>xQuery 见我上篇博客:<a id="homepage1_HomePageDays_DaysList_DayItem_0_DayList_0_TitleUrl_0"
class="postTitle2"
href="http://www.cnblogs.com/web-xuchang/p/3579910.html">封装自己的jQuery库xQuery</a> (弹性菜单技术来自智能社,在此感谢!) 把别人的东西整理一下,就成为自己的东西了.... |
基于xQuery,扩展自己的弹性菜单插件,布布扣,bubuko.com
原文:http://www.cnblogs.com/web-xuchang/p/3580045.html