Dec 11, 2002 #1 CC801340 IS-IT--Management Joined Jul 10, 2001 Messages 147 Location GB Hi I am after a piece of script that will do the following when a user clicks an image: 1) changes the image 2) waits 2 seconds 3) moves to a another page Many thanks in advance
Hi I am after a piece of script that will do the following when a user clicks an image: 1) changes the image 2) waits 2 seconds 3) moves to a another page Many thanks in advance
Dec 11, 2002 1 #2 elegidito Programmer Joined Jan 19, 2002 Messages 358 here ya go : Code: <script language="javascript"><!-- function swapImage() { e = event.srcElement; e.src = 'theNewImage.bmp'; setTimeout("document.location.href = 'newPage.html'",2000); } //--></script> and you could call it from the image like this: Code: <img src='firstimage.bmp' onClick='swapImage()'> hope it helps "Those who dare to fail miserably can achieve greatly." - Robert F. Kennedy So true.. Upvote 0 Downvote
here ya go : Code: <script language="javascript"><!-- function swapImage() { e = event.srcElement; e.src = 'theNewImage.bmp'; setTimeout("document.location.href = 'newPage.html'",2000); } //--></script> and you could call it from the image like this: Code: <img src='firstimage.bmp' onClick='swapImage()'> hope it helps "Those who dare to fail miserably can achieve greatly." - Robert F. Kennedy So true..
Dec 11, 2002 Thread starter #3 CC801340 IS-IT--Management Joined Jul 10, 2001 Messages 147 Location GB Geat! Thanks for that! Much appreciated! Upvote 0 Downvote