Last active
February 12, 2020 09:45
-
-
Save alrnz/56e8a309da4ffd299a1016b6239701f4 to your computer and use it in GitHub Desktop.
jQuery onResizeEnd Function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var resizeEndDelay = 150; | |
var resizeEndTimeout; | |
window.onresize = function(){ | |
clearTimeout(resizeEndTimeout); | |
resizeEndTimeout = setTimeout(function(){ | |
$(document).trigger('resizeEnd'); | |
}, resizeEndDelay); | |
}; | |
$(document).on("resizeEnd", function (event) { | |
console.log("I have not resized for " + resizeEndDelay + "ms"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment