javascript - delay in animation after several calls using jquery.animate -
I try to show the overlay after calling jquery.animate in a click event after clicking on the div and clicking on the div What I am doing after many clicks like 4 or 5 tries, I start to note that there is a delay in clicking on div and overlays and this delay is increasing after every click
In a detailed code and here is the JavaScript code
Function initTemplateEditor (params) {if (parameters type === "undefined") {new error ("Can not init editor without parameters!"); } Var openEditor = function () {$ (params.templateEditor). Value ({opacity: 1}, {duration: 350}, start: work () {$ (params.templateEditor) .css ({"display": "block", "width": $ (window) - 10, "height": $ (window). Height () - 10});}}); }, CloseEditor = function () {$ (params.templateEditor). Value ({opacity: 0}, 350, function () {$ (this) .css ("display", "none");}); }; $ ("Close the editor"). Click (function () {closeEditor ();}); OpenEditor (); } $ (Click "Template-box") (function () {initTemplateEditor ({templateEditor: "#templateEditor", Template: this});});
Every time you call initTemplateEditor
So you are adding this code to editorClose
click in the series
$ ("# editorClose") (function () {closeEditor ();}) ;
If you add a warning
inside the function, you will see that it is being called for the first time, twice, twice.
The click
function, and this should solve your problem before linking that code to that code immediately:
< Code> $ ("# editorClose") Unbind ("click");
Comments
Post a Comment