Quote:
|
How do I get started with your version for a picture to alternate like in your sample I looked at?
|
Hi
1. Get your images organised. Make them all the same pixel width and height. Assuming they're pics of players, name them "player0.jpg", "player1.jpg", "player2.jpg" ... etc. The name of the file must include a number that goes up by one each time.
2. In WP, put "player0.jpg" on your page in the right place. Right click the image and in Image Export Options select "Save to my chosen path and name", so that it stays named as "player0.jpg". At the foot of the dialog, select "Always use the original image file".
3. Right click the image again and select "Id ...". Enter an identifier such as "pic_0".
4. Go to Tools>Site manager>File manager. You'll see "player0.jpg" already in the list. Add all the other images via the "Add File" button.
5. Right click a blank area on the page and select "Attach HTML". Scroll to the foot of the code and locate the white area labelled "Page Body End". Click into that white area just after the "-->", and paste in this code:
Quote:
|
<script language="javascript">
var num_images = 7;
var picno = Math.floor((Math.random() * num_images));
document.getElementById("pic_0").src = "player"+picno+".jpg";
</script>
|
Change the highlighted number 7 above to be how many images you have. Make sure that the "pic_0" I've highlighted matches the id you chose in step 3.
That should be it ... I hope!