Mondeo Posted February 8, 2007 Posted February 8, 2007 I have this page which contains a "main" image and 3 detail shots http://www.florencefashions.com/product.aspx?product=23 When a detail shot is clicked then the main image changes to that one, i've just done this simply in the click event of the image control. The client wants it where the page doesnt jump to the top when its clicked, i.e. they want to avoid the postback. Can I do this in Javascript, if so any help appreciated as I have zero experience with JS! Thanks Quote
MrPaul Posted February 8, 2007 Posted February 8, 2007 Javascript image change Off the top of my head... <script type="text/javascript"><!-- function showimg(url) { //imgproduct is the image element in the HTML var imgelement = document.getElementById("imgproduct"); if (imgelement) imgelement.src = "products/" + url; } //--></script> <!-- The thumbnails themselves --> <img src="products/23a.jpg" onclick="javascript:showimg('23a.jpg')" /> <img src="products/23b.jpg" onclick="javascript:showimg('23b.jpg')" /> <img src="products/23c.jpg" onclick="javascript:showimg('23c.jpg')" /> Something like that. Good luck :cool: Quote Never trouble another for what you can do for yourself.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.