jquery - Apply same function in data-rel order -
I have several objects that I delays () and want to apply. Fidine () function but the function needs to be applied in the order of data-reliance numbers.
In addition, I need to delay the increment of 100 for each object ...
Here is a worksheet.
I want to delay it with the requirement of ; Div class = "feedin" & gt; & Lt; P class = "m" data-relay = "1" & gt; 1 & lt; / P & gt; & Lt; P class = "m" data-relay = "3" & gt; 2 & lt; / P & gt; & Lt; P class = "m" data-relay = "2" & gt; 3 & lt; / P & gt; & Lt; / Div & gt; data-rel = "1" with 0 data-rel = "2"
script:
$ (".me") .hide (); $ (".me") .each (function () {$ (this) .delay (0). FadeIn (500);});
simply calculate by value in delays Code> Relay
$ (".m"). Each (function () {var el = $ (this), rel = el.data ("rel"), delay = (relay -1) * 100; l. delay (delay). Fade (500);});
Comments
Post a Comment