javascript - jq的animate的一个方法?
怪我咯
怪我咯 2017-04-11 10:00:58
0
2
268

就是animate方法里面的

topOrLeft: "-=" +$("body")[widthOrHeight]() + "px"

这句。
经过debugger,就是这句话出错了,我把右边的换成"768px",在debugger里面显示的也是0px,topOrLeft传入的是"marginTop",请问哪里出错了?

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(2)
洪涛

没见过animate里有topOrLeft, 要不top, 要不left
要不你就这么写

var obj = {};
obj[topOrLeft] = "???";
$(???).animate(obj);
巴扎黑

http://www.w3school.com.cn/jquery/effect_animate.asp

看一下animate()的参数吧

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!