to make something run only the once this is it…
1 2 3 4 5 |
$(".button").one("click", function() { alert("This will be displayed only once."); }); |
OR you can use this as it runs only when loaded.
1 2 3 4 5 6 7 |
$(window).load(function(){ // .. myfunc(); // .. }); |