How to jump to an anchor / div per random button (jQuery mobile)?
I would like to make a random page effect in my jQuery Mobile app. Therefore I want to give the user a button to click, which jumps to / displ开发者_C百科ays a random page-div on the site. thats all.
var divs = jQuery.makeArray(document.getElementsByTagName('div'));
divs[Math.floor(Math.random()*(divs.size()+1))].doSomething();
精彩评论