I have a really simple function but I have been banging my head against a wall with implementing it. For some reason when I have ‘this’ selector in the function it doesn’t work at all but works without.
I need ‘this’ to apply the function to the selected div only when hovered.
Here is the jsfiddle i have been testing it on, I have tried everything I can think of but had no luck.
You are trying to select an element by class within specified context (specified element), and this is what jQuery does for you. However, you should expect that jQuery cannot find your
galleryheaderwithin the image, as it is not a child of the image.Your header is contained withing div with class
gallery-grid, which you should use in this case.It would look like this:
http://jsfiddle.net/NqXHF/3/