Jquery animate not working in chrome

my jquery animation code works fine in IE and firefox, but it doesn't work in Chrome and safari. any suggestions?

this is my animation code for jquery

$('#menu ul li a').click(function (e) {

    /* On a thumbnail click */
    $('li.menuItem').removeClass('act').addClass('inact');
    $(this).parent().addClass('act');

    var pos = $(this).parent().prevAll().length; //.prevAll('.menuItem').length;
    pos = pos - 1;


    $('#slides').animate({ marginLeft: -positions[pos] + 'px' }, 450);
    /* Start the sliding animation */

    e.preventDefault();
    /* Prevent the default action of the link */
});
+5
source share
2 answers

, jQuery 'px' css , , - , . css? "": "" "": "" "": " " , . css . "left" "margin-left", , , css .

+3

left marginLeft.

+2

All Articles