Hi Guys.
I have implemented a simple show/hide layer script on my website. This is what I've got:
And the code used to call it:Code:<script language="javascript"> var show_layer = true; function showLayer(){ var divlayer = document.getElementById('divlayer'); divlayer.style.display = show_layer?'':'none'; show_layer = !show_layer; } </script>
Code:<a href="javascript:showLayer()" class="readmore"><img src="img/more.gif" border="0" /></a><a href="javascript:showLayer()" class="readmore">Read More</a>
Now, the script works just fine - No problems there.
But I would also like to change the text and the image at the button link to some things else so that users know that they have already clicked on that.
For example: From "Read More" --> "Hide this" (and then goes back to Read More after have clicked on it)
As well as the image"more.gif changes to "hide.gif".
(I hope this make some sense '- -)
I can't figure out where to add that to my code. Any help would be greatly appreciated!!!
Thanks![]()



Reply With Quote


Bookmarks