开发者

Is it possible to use animate the top positioning of an element using percentages and a variable?

'thisAnchorMargin is an float. why doesn't this work? if i just put a numerical value in there and don't concatenate the % (e.g. top: 50%) it works. is this not a valid unit type to animate in jquery?

$('.mar开发者_C百科kerContainer').stop().animate({
    top: thisAnchorMargin + '%'
    }, {
    duration:scrollSpeedGlobal,
    queue:false
    });


I tried it with several different floats (concatenating the '%') and it works just fine, at least in Chrome/Mac. http://jsfiddle.net/9d6ck/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜