Skip to content

Instantly share code, notes, and snippets.

@neilgee

neilgee/scrollo-link.php

Last active Jun 27, 2017
Embed
What would you like to do?
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