I'm trying to have text appear on mouseover event with JS and I found a working JS that will do what I want but it only seems to work on one of the DIVs and not all of them.
Here is the HTML:
<TABLE><TR>
<TD><A href="#"><DIV id="lImg">
<IMG width=210px height=160px src="/img.png">
<DIV id="lTxt">TXT1<BR>TXT2</DIV>
</DIV></A></TD>
<TD><A href="#"><DIV id="lImg">
<IMG width=210px height=160px src="/img.png">
<DIV id="lTxt">TXT1<BR>TXT2</DIV>
</DIV></A></TD>
</TR></TABLE>
and this is the JS:
$(window).load(function(){
$('#lImg').hover(
function(){
$(this).find('div').stop(true, true).animate({
'bottom': '+=60'
}, 300);
},
function(){
$(this).find('div').stop(true, true).animate({
'bottom': '-=60'
}, 250);
}
);
});
I have Multiple DIVs that I want this to work on but I don't know too much about JS and I tried tinkering with it a little and got no fix personally. So I'm just trying to find a way to basically have all my DIVs that are "lImg" to have the same mouseover event work without having to make multiple JS files.
My Apologies if this was asked before, I must have missed it or searched for the wrong keywords.
If this can also be done in a simpler way I'm up for that too.