Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
188
rated 0 times [  191] [ 3]  / answers: 1 / hits: 15603  / 11 Years ago, fri, january 31, 2014, 12:00:00

i want to use onmouseover so that it replaces preview picture with thumbnail picture when mouse is on it..
below code works fine on firefox and IE but not working on chrome..
here is the link where it is applied samdesign.comli.com/gallery.html



    <div class=gallery align=center>
<h1>Photo Gallery</h1><br/>

<div class=thumbnails>
<img onMouseOver=preview.src=img1.src id=img1 src=images/Salman_Siddiqui.jpg alt=Image Not Loaded/>
<img onMouseOver=preview.src=img2.src id=img2 src=images/slide6.jpg alt=Image Not Loaded/>
<img onmouseover=preview.src=img3.src id=img3 src=images/slide1.jpg alt=Image Not Loaded/>
<img onmouseover=preview.src=img4.src id=img4 src=images/slide2.jpg alt=Image Not Loaded/>
<img onmouseover=preview.src=img5.src id=img5 src=images/slide3.jpg alt=Image Not Loaded/>
<img onmouseover=preview.src=img6.src id=img6 src=images/slide4.jpg alt=Image Not Loaded/>
<img onmouseover=preview.src=img7.src id=img7 src=images/slide5.jpg alt=Image Not Loaded/>
<img onmouseover=preview.src=img8.src id=img8 src=images/slide7.jpg alt=Image Not Loaded/>
</div><br/>

<div class=preview align=center>
<img id=preview src=images/Salman_Siddiqui.jpg alt=No Image Loaded/>
</div>

<br/>

</div>

More From » jquery

 Answers
4

Try using getElementById instead:



onmouseover=document.getElementById('preview').src=document.getElementById('img8').src

[#72811] Thursday, January 30, 2014, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
brianaclaras

Total Points: 23
Total Questions: 106
Total Answers: 111

Location: Japan
Member since Sat, Jun 6, 2020
4 Years ago
brianaclaras questions
Fri, Oct 15, 21, 00:00, 3 Years ago
Thu, Dec 3, 20, 00:00, 4 Years ago
Mon, May 25, 20, 00:00, 4 Years ago
Wed, Mar 4, 20, 00:00, 4 Years ago
;