[jQuery] Re: Using "this" with jQuery

2008-06-27 Thread Richard D. Worth
In that case $(this).prev(".seriesOverlay") should do. - Richard On Fri, Jun 27, 2008 at 12:27 PM, hubbs <[EMAIL PROTECTED]> wrote: > > This is almost what I need. But .seriesOverlay is not a child, but > the previous div in the DOM, so it is right above it. > > Maybe I could use $(".seriesOver

[jQuery] Re: Using "this" with jQuery

2008-06-27 Thread hubbs
This is almost what I need. But .seriesOverlay is not a child, but the previous div in the DOM, so it is right above it. Maybe I could use $(".seriesOverlay + .seriesItem")? On Jun 26, 2:47 am, "Richard D. Worth" <[EMAIL PROTECTED]> wrote: > If your .seriesOverlay is a child of your .seriesItem

[jQuery] Re: Using "this" with jQuery

2008-06-26 Thread Richard D. Worth
If your .seriesOverlay is a child of your .seriesItem[1], you can do: $(".seriesItem").mouseover(function() { $(".seriesOverlay", this).hide(); }).mouseout(function() { $(".seriesOverlay", this).show(); }); Why this works: * The thisArg in jQuery callbacks is always equal to the original elem

[jQuery] Re: Using "this" with jQuery

2008-06-26 Thread tlob
Add a class to your IDs, then it should work: [code] div {border:1px solid #ccc;width: 100px;height:100px;margin: 10px;float:left;}