<a href="$val[description]" class="product_hov">
<p class="pv">
<p class="dii" onMouseOver="this.style.backgroundColor='#00755D'" onMouseOut="this.style.backgroundColor='#DADADA'">
<img src="$val[imgurl]" alt="$val[title]" title="$val[title]" width="{$lang_imgwidth}" height="{$lang_imgheight}" class="product_img" onMouseOver="change_img_product(this,'$val[imgurls]')" onMouseOut="change_imgs_product(this,'$val[imgurl]')"/>
<p class="product_di">
<dd clss="product_nm">$val[title]</dd>
<p class="product_long">
<font class="product_wz" style="text-align: center;">$val[issue]</font>
</p>
</p>
</a>
Now the image src is changed when the mouse stays on the img. I want to add the Onmouse attribute directly to the a link. How to find the node of this img and change the src of the img? Thank you
function change_img_product(obj,img){
$(obj).attr("src",img);
}
function change_imgs_product(obj,img){
$(obj).attr("src",img);
}
You add a class or id to the img tag. When the mouse is on the a tag, you can find the corresponding class or id and find the img. Then switch the img src value
You guys, this is specifically
$("a").hover(function(){
// Go in
$(this).find('img').src('')
},function(){
$(this).find ('img').src('')
//come out
});