javascript - onmouseover not working on chrome? -
i want use onmouseover replaces preview picture thumbnail picture when mouse on it.. below code works fine on firefox , ie not working on chrome.. here link 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>
try using getelementbyid
instead:
onmouseover="document.getelementbyid('preview').src=document.getelementbyid('img8').src"
Comments
Post a Comment