March 2, 200917 yr Hi all On our classic car club website we have a writeup each month of the last event. The text includes photos that can be enlarged by clicking on them. A double click then restores the original photo. This is done by this JS code: <img src="/non_gallery_photos/feb2009run/eco_hotel_start1.jpg" width=300 height=180 hspace=10 vspace=15 align=right alt="Eco Hotel Start" onclick="src='/non_gallery_photos/feb2009run/eco_hotel_start1.jpg'; width=500; height=280; hspace=10; vspace=15 "; ondblclick="src='/non_gallery_photos/feb2009run/eco_hotel_start.jpg1'; width=300; height=180; hspace=10; vspace=15 " /> However, each month, one out of three or four photos is "lazy" and won't return to the original state after being enlarged - a different one in a different location each month. It just shows the space and not the image - just the Alt tag. Anyone viewing the site has to hit F5 to refresh the page. When we write the story I usually cut and paste the above code from place to place and just change the align tags depending on the layout, so there shouldn't be any typos or whatever. Please have a look if you would at this link of the offending page: Sol Classic Car Club/Last Event where the first image is the problem. Any help really appreciated. Many thanks RJ
March 3, 200917 yr I've not looked to much at it but I'd definately consider changing your inline code to a javascript function, something LIKE below: <script type="text/javascript"> function resizeImage(image_id,new_image){ document.getElementById(image_id).src = new_image; } </script>
March 3, 200917 yr Author I've not looked to much at it but I'd definately consider changing your inline code to a javascript function, something LIKE below: <script type="text/javascript"> function resizeImage(image_id,new_image){ document.getElementById(image_id).src = new_image; } </script> skidz - thanks for the reply. I'll certainly give this a go. I will have to find some info on the code itself, as I am a complete noob when it comes to js. The snippet I am using was a straight lift from code I found on the internet. Thanks again.
March 5, 200917 yr On the double-click command on the first image, you are changing the source to eco_hotel_start.jpg1. Removing the 1 will solve your problem. You may find it easier not to use your current script and use something like Lightbox to make a larger image appear when the user clicks on the image.
March 5, 200917 yr Author On the double-click command on the first image, you are changing the source to eco_hotel_start.jpg1. Removing the 1 will solve your problem. You may find it easier not to use your current script and use something like Lightbox to make a larger image appear when the user clicks on the image. Brilliant - thanks for spotting the typo. I couldn't see the wood for the trees! I'll look at Lightbox - muchas gracias for the help RJ EDIT: Can anyone help how to mark this up as SOLVED? Cheers
Create an account or sign in to comment