UItoTop-jQuery-Plugin
UItoTop-jQuery-Plugin copied to clipboard
Window scroll events
When a user scrolls the page, multiple events are called, even for a single scroll. You can see it in Firebug. Because of this, the plugin is slow on single core computers (browser gets unresponsive) and browsers that have scroll events plugins. To fix this, this is what I have done and it works great:
After "jQuery.fn.UItoTop = function(options) {" I set a variable "var _t;" . After this "jQuery(window).scroll(function() {" I set "clearTimeout(_t);" and wrap the whole code below in "_t = setTimeout(function() { /* code */ }, 100);"
I hope this gets implemented. And thanks for this plugin.