开发者

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();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜