Forum Moderators: open

Message Too Old, No Replies

onclick event not working in IE7

         

CazzyH

8:12 pm on May 4, 2007 (gmt 0)

10+ Year Member



Hello, please be gentle, this is my first post and my first website!

The website is in the form of a gallery for displaying jewellery products, each item and item description is displayed in a table. The page loads with small gallery images and I am using 'onclick' to enlarge the image and 'ondblclick' to return to the smaller size. The code works fine in FF, Opera and Sea Monkey, but in IE6 and IE7 the image does not display when trying to enlarge it - although it did work sporadically in IE7 for a while. The code for the table cell where the image is displayed is:

<td rowspan="3" bgcolor="#e3e9f2" width="30%" align="center">
<img src="pics/bracelets/CH00126.jpg" alt="CH00126 - Brown Bead Charm Bracelet" width="150" height="150" onclick="this.src='CH00126.jpg';this.height=450;this.width=450" ondblclick="this.src='CH00126.jpg';this.height=150;this.width=150"></td>

This is driving me nuts but being new to all this I just don't have the depth of knowledge to fix it. Any suggestions.......please?!

encyclo

8:22 pm on May 6, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld CazzyH, and sorry it took so long to get a reply. Are you seeing any Javascript errors in the status bar in IE? Is there any other scripting affecting this element? I've tested your exact code and it works as expected in IE6.