I am trying to get it so when the mouse moves over the div it fades the image inside
function clickimage($imageid){
$("#image_"+imageid).hover(function(){
$(this).fadeTo("slow", 1.0);
},function(){
$(this).fadeTo("slow", 0.6);
});
}
<div id='images_$imageid'>
<a href='?tg=photos&photo=$imageid' onmouseover=\"javascript:clickimage('$imageid')\">
<img src='users/$ptgid/images/$iimg' width='100' height='100'/>
</a>
</div>
You would want to set the binding when the document loads, not every time the mouse hovers over the image. Also, I would create a class so that you can initialize the hover on each item
For the link, you would do something like this:
If you want to do the hover on the
div, you could do this instead (but I recommend doing the hover on the<a>tag):For the div, you would do something like this: