jQuery animate and property values in percentage

后端 未结 6 1784
孤城傲影
孤城傲影 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条回答
  •  萌比男神i
    2020-12-02 00:29

    This is pretty old, but this way is working for me:

    wthSelected = 85;
    $(this).animate({
        width:wthSelected+'%'
      }, 1500); 
    

    Also i'm using jquery-1.11.2.min.js and jquery.mobile-1.4.5.min.js

提交回复
热议问题