jquery - How to display a image from a table in a div when i mouse hover to the table row? -


consider have table 2 rows. each rows contains user image. ( have populated table data json using ajax call). , when mouse hover particular row, should display particular rows image in div. how achieve using jquery ?

i think want show image in div. have solved in fiddle. here jsfiddle

html code

<table>     <tr>         <td><img src="http://www.mentoringminds.com/images/linkedinicon.png" alt="" /></td>     </tr>     <tr>         <td><img src="https://cdn4.iconfinder.com/data/icons/pictype-free-vector-icons/16/view-256.png" alt="" /></td>     </tr> </table>  <div id="displaydiv">     <img src="" alt=""/> </div> 

js code

$("td img").mouseover(function(){     $("#displaydiv img").attr("src",$(this).attr("src")); }); 

hop, may you. have nice day. :)


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -