I have around 100 items in a jQuery Mobile listivew. Is it possible to focus on Nth element in a listview that is generated dynamically??
I know is possible in Android and iPhone but not sure how it is done in jQuery Mobile.
Thanks for your time in advance.
jQuery Mobile does support
scrollTopso you could do something like this:Or update your selectors to match the
liyou would like to scroll to.The code above works on the jqm list view example page. Try it! Go here: http://jquerymobile.com/test/docs/lists/lists-ul.html and enter the code above in your console. It should scroll down to the last item.
UPDATE
After looking up something else in the jqm documentation, I came across this:
//scroll to Y 300px
$.mobile.silentScroll(300);
Found here: http://jquerymobile.com/test/docs/pages/page-scripting.html, under “Scrolling to a position within a page”. The trick with this is that it was designed to help preserve page position and back button behavior.
Hope this helps!