问题描述:

I have the following and I am trying to animate this so that it will move left from it's position so I am trying:

<ul id ="bla" data-role="listview" data-inset="true"><li>bla</li></ul>

$("#bla").animate({left:"200px"},{duration:"slow"});

but it is not working.

网友答案:

Did you insert your JQuery code on page load event handler?

$(document).ready(function () {
   $("#bla").animate({left:"200px"},{duration:"slow"});
});

EDIT : You also have to change your HTML;

<ul id ="bla" data-role="listview" data-inset="true" style="position:relative;"><li>bla</li></ul>​​​​​​​​​​​​​​​​

Here is working fiddle : http://jsfiddle.net/b7HJf/2/

Hope this helps.

相关阅读:
Top