javascript - Affect only the onhover div tag with JQuery and SLidedown() function -


Is there any way that is a jQuery sleddain () function that will only be mounted on the div where the focus is on the mouse.

Such a thing is possible with the combination of JQuery, but I have managed to achieve it only: I can only do it if there is a separate class in each div. If I give them the same name, then it will first open all the tags (slide down) on the hover of the diva.

So, I hope this is a simple solution that I can not see.

HTML

  & lt; Div class = "q1"  

& gt; 1. Question (on hover) & lt; Br / & gt; & Lt; div class = "desc1" & gt; Description: Here is a php variable with & lt; / Div & gt; & Lt; Br / & gt; & Lt; / Div & gt; & Lt; div class = "q2" & gt; 2 questions (on hover) & lt; Br / & gt; & Lt; div class = "desc2" & gt; Description: Here is the question from php variable / Div & gt; & Lt; Br / & gt; & Lt; / Div & gt; & Lt; div class = "q3" & gt; 3 questions (on hover) & lt; Br / & gt; & Lt; div class = "desc3" & gt; Description: Here the question is three php variables and so on & lt; / Div & gt; & Lt; Br / & gt; & Lt; / Div & gt;

JQUERY

  jQuery (function () {for (var i = 0; i & lt; 100; ++ i) {(function (i.) (jQuery. ('. Desc' + i) .hide (); jQuery ('q' + i) .hor (function () {jQuery ('. desc' + i, this) stop (True, true) .Del (300). SlideDown (300);}, function () {jQuery ('. Desc' + i, this). Stop (True, True) .SlideUp (200);}); (I));}});   

CSS

  .desc1, .desc2, .desc3 {font-size: 12px; Font style: italic; } .q1, .q2, .q3 {font-weight: bold; }   

Therefore, it is working on only three questions, but what about the hundred? With my code it would be useless to create css for every div, so I know that there is a simple solution :) or no: (

The field:

script:

  jQuery (" .desc "). hide (); jQuery (" q ") .hower (function () (function () (.find (".desc"). Stop (). Slide down ("slow");}, function () {jQuery (this) .find (".desc" ) .slideUp ("slow");});    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -