ok.. here is what i wanna to do.. I have about 4 div layer... and wanna to show that 4 div layer one by one after some one click on button. also, if possible, the delay between one layer to one layer showing is randomize between 5 to 9 second.
I cannot write the code for you as I am not surfing from my cosy home but from an cafe. But I will give you leads. 1. Create and array of all DIVs using the getEementsByTagName() function. alldiv=document.getElementsByTagName("div"); Code (markup): 2. Calculate the length of the array. no=alldiv.length; Code (markup): 3. Now, at random pick any value from the array using the randomno=Math.floor(Math.random()*no); //no is the number of elements in the array initially Code (markup): 4. Establish reference to the randomly selected DIV by using randomdiv=alldiv[randomno]; Code (markup): 5. Now manipulate the display of that DIV randomdiv.style.display="inline"; Code (markup): 6. Delete this random DIV from our array of divs which we created in step 1. delete alldiv[randomno]; Code (markup): 7. Repeat steps 2 to 6. Now put these in a function such as showRandomDiv() and call that function at preset intervals with setInterval() function. Remember to clear the interval when there are no items left in the alldiv array(because that means that all divs are now made visible). I have not tested this code because I am not at my home place right now. Enjoy, also you may need little modifications particularly in step 1 and step 4. You may consider using IDs and getElementById() functions there.
thanks for your guide... but i'm freshy in javascript. Could somebody write the code in proper... where to put this script, either it could be put in BODY or must put in the HEAD. Plz... help me... Here is details what i wanna to do: 1. Some one click the button 2. <div id="layer1"> show ... delay (randomize between 5 - 9) 3. <div id="layer2"> show ... delay (randomize between 5 - 9) 4. ... 5. ...