开发者

Random image display from a folder

开发者 https://www.devze.com 2023-01-14 14:39 出处:网络
I want to do a image slider in my dotnet nuke project. Ie want to display image one after other. Is there is any free module for that? or

I want to do a image slider in my dotnet nuke project. Ie want to display image one after other. Is there is any free module for that? or Is there is any way to display(one 开发者_C百科after another like slide show) all the images from a folder using java script or jquery?

Thanks in advance


use dnn's inbuild widgets to do so: take a look at this page and find RotatorWidget


var divs = $("div.Image").get().sort(function(){ return Math.round(Math.random())-0.5; //so we get the right +/- combo }).slice(0,4); $(divs).show();

If you want to also randomize the order (not just which are shown), you already have them sorted so just append them to the same parent in their new order by changing this:

$(divs).show(); //to this: $(divs).appendTo(divs[0].parentNode).show();

0

精彩评论

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