I have some problems with this for a few hours and have not managed to find solutions, although I understand the reason Problem's.
I clone the elements one by one and when I remove them from the top of the scroll bar apers, to change the colors from red or black depending on the number generated by the elements The phenomenon of Moissardown is.
My problem occurs when the first element is removed (initial red with color), clone (clone) with the next one color change. I only want to clone the initial class.
This incident occurs because I want to tell the machine to use the method .first ()
which element I want to clone. If I remove .first ()
, then the clone () method will create several elements instead of one per time, but this will also cause the problem to make the changing color element.
Here is the code:
var current = false $ (document). Click (function () {if (running)} {return}} running = true; var endless = SetInterval (function () {var random = Math.floor (2 * Math.random ()); var math = ( Random ('' background '' ('background', 'silver', 'background' $ ('Body', 'html'), chetan ({scrollTop: '+ = 70'}, 1000, 'linear')}, 1000); $ (window); unbind ('mousedown')}}; On ('scroll', function (if ($ (".: First"). Offset (). Top + $ ("square: first"). Height () <$ (window) .scrollTop () ) {$ ("Class: first"). Remove ()}})}}
Please be hello.
This event occurs because I used the method (first) I want to clone.
It seems as if you Want to remember for future cloning, so that your running
variable, add:
var class;
And then change it:
$ ("square"). first (). Clone () AddClass (...
if (! Square) {class = $ ("square"). First ();} class.clone (). AddClass (... >
No comments:
Post a Comment