Jquery Selector Multiple Classes (this) -


I have a page that lists the content of the category that is included in a div with a class ad-container There is a hidden div with class ad-contact in that container. I want to bring the advertisement performance on the ad hover. Since there are many ads on a patent page, I want the ad-container ad-information currently being filled. My problem is that when you run on one of the ads, more than 10 ads are one page, all ad-contact divs slidedown and not the one you're slipping on

  $ (Document) .ready (function () {$ ('ad-container'). Hover (function () {$ (". Ad-contact"). Slide Down (1000);}, function () {$ ("Ad-contact"). SlideUp (1000);});});   

I think, (this) is used here but I'm not sure. And it will really be highlighted for me.

  & lt; Div class = "ad-container" & gt; & Lt; Div class = "ad-title" & gt; Title & lt; Span class = "ad-title-img" & gt; (Pic) & lt; / Span & gt; & Lt; / Div & gt; & Lt; Div class = "ad-description" & gt; Text Text & lt; / Div & gt; & Lt; Div class = "ad-contact" style = "display: none" & gt; Contact Poster & lt; / Div & gt; & Lt; Div class = "ad-sellerinfo" style = "display: none" & gt; * Verified *** - **** & lt; Br / & gt; Paid member & lt; / Div & gt; & Lt; / Div & gt;    

The Creator of jQuery accepts a second parameter, which is used to override that reference Can be selected for. Something like this should be done:

  $ (document) .ready (function () {$ ('ad-container') hover (function () {$ (".ad- contact ", This) .SlideDown (1000);}, function () {$ (" ad-contact ", this) .slideUp (1000);});});   

In addition, worth mentioning, $ (". Ad-contact", this) changes internally: $ (this) .find (".ad-contact") so that you can use this one instead, it can be a little faster.

Comments