Jump to content

document.getElementById & hidden image problem


Recommended Posts

Greenhorned Newbie here. Thanks for your patience.

 

In a mobile environment I discovered my "button" image disappears. This happens right after the image is clicked and the new page is loading. Is this event bubbling? How would I account for it?

<a style="text-align: center; border-style: none;" href="http://" style="color: #000000" onmouseover="document.getElementById('pic1').src='b.png'; this.style.color='#0ebfe9'" onmouseout="document.getElementById('pic1').src='a.png'; this.style.color='#000000'"><img src="a.png" id="pic1"><br>Click-here</a>

I chose using the above over css and a:hover becuase of the brevity of code. It also seemed to be overall easier for me to line up images with their corresponding linking text.

 

Thanks for any suggestions,

David

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...