Monday, January 26, 2009

[jQuery] this (class) + id + text

Hey,

sorry for the weird topic but i couldn't find a better one so i choose
this! ;)

Right now, i got this code:

$('.show_image').hover(
function(){
$('.image').show();
},
function(){
$('.image').hide();
}
);

The href looks like this:

<a href="#" class='show_image' id="image_1">Show Image 1</a>
...

So, if i mouseover one of my 10 show_image classes, all image are
shown. What i want is, that only the image with the select ID is
shown.
I thought, that i could do something like this:

$(this).ID of this.some text to reach the image.show()

I hope you understand what i mean.

Thanks for your help

Flo

No comments: