jQuery animate and property values in percentage

后端 未结 6 1776
孤城傲影
孤城傲影 2020-12-02 00:03

I trying to animate a div and I try to use some value retreived somewhere else, I know the value to be correct because I\'ve printed out the output... so I\'m wondering why

6条回答
  •  离开以前
    2020-12-02 00:32

    Try adding the units text like this:

    function animateBar(percentage)
    {
        $('#innerBox').animate({width: percentage+"px"}, 3000);
    }
    

提交回复
热议问题