How to replace image onmouseover
-
Hey I want to change a image that is in one td when my mouse moving over a onther element like (text, another td, tr, table) example : // the image that needed to be switch with another image
TEXT
// here i want to creat a mouseover/out option please help thank's
-
Hey I want to change a image that is in one td when my mouse moving over a onther element like (text, another td, tr, table) example : // the image that needed to be switch with another image
TEXT
// here i want to creat a mouseover/out option please help thank's
Hi, using JQury can do the trick. First assign id to your table/image elements, for example
<table id="table1">
<tr>
<td>
<b><img id="img1" src="ABC.jpg"/></b>
</td>
</tr>
</table>
<table id="table2">
<tr>
<td>
<b>TEXT</b>
</td>
</tr>
</table>Now use jquery
$("#table2").mouseover(function() {
$("#img1").attr("src","xyz.jpg");
}).mouseout(function(){
$("#img1").attr("src","abc.jpg");
});Thus mouseover event triggers each time you hover table2 and change the image to xyz.jpg you will get similar concept from here[^] Hope this will help
-
Hi, using JQury can do the trick. First assign id to your table/image elements, for example
<table id="table1">
<tr>
<td>
<b><img id="img1" src="ABC.jpg"/></b>
</td>
</tr>
</table>
<table id="table2">
<tr>
<td>
<b>TEXT</b>
</td>
</tr>
</table>Now use jquery
$("#table2").mouseover(function() {
$("#img1").attr("src","xyz.jpg");
}).mouseout(function(){
$("#img1").attr("src","abc.jpg");
});Thus mouseover event triggers each time you hover table2 and change the image to xyz.jpg you will get similar concept from here[^] Hope this will help
-