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
Post a Comment