开发者

jquery CSS properties not set properly in Chrome

开发者 https://www.devze.com 2023-01-14 04:09 出处:网络
The following line of code doesnt seem to be doing anything in chrome but works perfectly fine in other browsers

The following line of code doesnt seem to be doing anything in chrome but works perfectly fine in other browsers

$('#slides').stop().animate({marginLeft:-positions[pos]+'px'},450);

Can anyone tell me a fix? The actual site can be viewed here

http://eyant开发者_如何学Cra.akshar.frihost.net/ci/


I solved this by using position left instead of margin-left.

$("#slides).css("position","relative"); 
$('#slides').stop().animate({left:-positions[pos]+'px'},450);
0

精彩评论

暂无评论...
验证码 换一张
取 消