/** * 2018 XTO * * XTO Scroll Top * * NOTICE OF LICENSE * * This source file is subject to the General Public License (GPL 2.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/GPL-2.0 * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade the module to newer * versions in the future. * * @author XTO * @copyright 2018 Expertos Tiendas Online * @license http://opensource.org/licenses/GPL-2.0 General Public License (GPL 2.0) */ $(document).ready(function() { $('.xto_scrollup').click(function(event) { event.preventDefault(); $("html, body").animate({ scrollTop: 0 }, 600); return false; }); $(window).scroll(function() { if ($(this).scrollTop() > 50) { $('.xto_scrollup').fadeIn(); } else { $('.xto_scrollup').fadeOut(); } }); });