Skip to content

Instantly share code, notes, and snippets.

@neilgee
Last active March 6, 2019 07:59
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neilgee/6ddbf844e6b2004ca86c514a2ce24796 to your computer and use it in GitHub Desktop.
Save neilgee/6ddbf844e6b2004ca86c514a2ce24796 to your computer and use it in GitHub Desktop.
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