I am using a slide show from the link :
http://www.alohatechsupport.net/webdesignmaui/maui-web-site-design/easy_jquery_auto_image_rotator . I need the first image to be also a random one. I had given a same class for all the li like 'rand'.Then
var curr=$('div.rotator ul li.rand');
var rc= Math.floor(Math.random() * curr.length);
var current=$(curr[rc]);
But i am stuck with what to do next..plz help!!
The code you have used for your slideshow is too much. this can be done much simpler. Have a look a this example of a slideshow with random images: http://jsbin.com/iledo3/3
The code pasted here for reference:
You can randomize the order of your LI elements using this awesome JQuery shuffle plugin by James Padolsey.
I have used it on a project recently and it worked very well for my needs.
Plus, the source of it is very easy to read (therefore easier to understand).
http://james.padolsey.com/javascript/shuffling-the-dom/
To use this in the context of a slideshow, you could use JQuery Cycle plugin by Mark Alsup. Shuffle the dom first, then run the slideshow:
Here is another jQuery plugin that does the same ting:
http://yelotofu.com/labs/jquery/snippets/shuffle/demo.html
Going off the demo that you gave that you can download here
http://www.alohatechsupport.net/downloads/image-rotator.zip
Make sure you follow these intstructions in the code
And then below your document ready section will look like: