开发者

jQuery block moving

开发者 https://www.devze.com 2022-12-11 19:27 出处:网络
I wanna move a div blo开发者_开发知识库ck to the top, so I coded like this: CSS part: .movingPart{

I wanna move a div blo开发者_开发知识库ck to the top, so I coded like this:

CSS part:

.movingPart{
margin-top:80px;
}

jQuery part:

$(document).ready(function() {

$('#btn').click(function() {


    $('.movingPart').animate({
        "margin-top":'0px'

    });


});

});

it works perfectly in chrome, but doesn't move a little in firefox, why???

thanks in advance


The jQuery docs indicate that you should use camelCase for properties when using animate.

Note that properties should be specified using camel case, e.g. "marginLeft" instead of "margin-left."

0

精彩评论

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

关注公众号