Skip to content

Instantly share code, notes, and snippets.

@neilgee neilgee/back-to-top.css
Last active Mar 6, 2019

Embed
What would you like to do?
Back to Top on Beaver Builder
#toTop {
display: none;
position: fixed;
bottom: 5px;
right: 10px;
width: 80px;
height: 80px;
opacity: 0.8;
filter: alpha(opacity=40); /* For IE8 and earlier */
}
#toTop:after {
content: "\f343";
font-family: dashicons;
color: #fff;
background-color: rgba(191,48,0,.5);
font-size: 35px;
border-radius: 50%;
padding: 5px;
}
<a href="#top" id="toTop"></a>
jQuery(document).ready(function($){
$(function() {
$("#toTop").scrollToTop(800);
});
});
/*!
jQuery scrollTopTop v1.0 - 2013-03-15
(c) 2013 Yang Zhao - geniuscarrier.com
license: http://www.opensource.org/licenses/mit-license.php
*/
(function(a){a.fn.scrollToTop=function(c){var d={speed:800};c&&a.extend(d,{speed:c});return this.each(function(){var b=a(this);a(window).scroll(function(){100<a(this).scrollTop()?b.fadeIn():b.fadeOut()});b.click(function(b){b.preventDefault();a("body, html").animate({scrollTop:0},d.speed)})})}})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.