Thursday, 11 April 2013

How to - Click one image to reveal another

This code is great when something is being revealed for an event 
(a book cover reveal for example).

The code:

<script type="text/javascript">
function changeImg(img, newimg) {
img.src = newimg;
<img onclick="changeImg(this, ' URL OF HIDDEN IMAGE ')" src=" URL OF SURFACE IMAGE " />

The effect works best with images of the same size. 
That's it folks, nice and simple. If you do have any questions though, please leave a comment or mail me.


No comments :

Post a Comment

Facebook Twitter Google + RSS Feed Email Me