I’ve got a div#element that I’m changing css style in interval using jquery.
var i = 0;
function changeStyle() {
$("#element").css("left",i+1);
}
setInterval("changeStyle()",500);
How do I stop element from changing the style for a while? Is there something like $("#element").stop(); function that enables me to disable element from changing anything on it?
I don’t want any other solution for this problem, I just want to know if there’s anything like stop() function.
The best method to accomplish that is to create an
!importantCSS rule:If the current element does not have an ID, you can temporary assign one.
When the element has to be “unlocked” again, use: