/** * jquery.totop.js v1.1 * developed by: mmk jony * fork on github: https://github.com/mmkjony/jquery.totop **/ !function(o){"use strict";o.fn.totop=function(t){var i=this,e=o(window),s=o("html, body"),n=o.extend({autohide:!0,offset:420,speed:500,position:!0,right:15,bottom:20},t);i.css({cursor:"pointer"}),n.autohide&&i.css("display","none"),n.position&&i.css({position:"fixed",right:n.right,bottom:n.bottom}),i.click(function(){s.animate({scrolltop:0},n.speed)}),e.scroll(function(){var o=e.scrolltop();n.autohide&&(o>n.offset?i.fadein(n.speed):i.fadeout(n.speed))})}}(jquery);