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 & 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 CSS 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:
& lt; Div class = "q1"
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));}});
.desc1, .desc2, .desc3 {font-size: 12px; Font style: italic; } .q1, .q2, .q3 {font-weight: bold; }
jQuery (" .desc "). hide (); jQuery (" q ") .hower (function () (function () (.find (".desc"). Stop (). Slide down ("slow");}, function () {jQuery (this) .find (".desc" ) .slideUp ("slow");});
Comments
Post a Comment