Skip to content

Instantly share code, notes, and snippets.

@neilgee
Last active June 27, 2017 23:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neilgee/95d7544fcf101f47357ed495c30cf002 to your computer and use it in GitHub Desktop.
Save neilgee/95d7544fcf101f47357ed495c30cf002 to your computer and use it in GitHub Desktop.
Scroll to Top - My Choice of posion
#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: #444;
font-size: 35px;
border-radius: 50%;
padding: 5px;
}
jQuery(document).ready(function($){
$(function() {
$("#toTop").scrollToTop(800);
});
});
<?php //<~ don't add me in
add_action( 'wp_enqueue_scripts', 'scrollo_scripts_styles', 997 ); // All the rest load before.
function scrollo_scripts_styles() {
wp_enqueue_script( 'scrollo' , get_stylesheet_directory_uri() . '/js/jquery.scrollToTop.min.js', array( 'jquery' ), '1', true );
wp_enqueue_script( 'scrollo-init' , get_stylesheet_directory_uri() . '/js/scroll-init.js', array( 'scrollo' ), '1', true );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment