Skip to content

Instantly share code, notes, and snippets.

@CSElliyas
Last active February 8, 2017 16:38
Show Gist options
  • Select an option

  • Save CSElliyas/a135f3a5182e1be42cc7f336f9776837 to your computer and use it in GitHub Desktop.

Select an option

Save CSElliyas/a135f3a5182e1be42cc7f336f9776837 to your computer and use it in GitHub Desktop.
compromath js
$(document).ready(function(){
$(window).scroll(function(){
if ($(this).scrollTop() > 300) {
$('.scrollToTop').fadeIn();
} else {
$('.scrollToTop').fadeOut();
}
});
$('.scrollToTop').click(function(){
$('html, body').animate({scrollTop : 0},800);
return false;
});
});
function myFunction() {
var x = document.getElementById("myTopnav");
if (x.className === "topnav") {
x.className += " responsive";
} else {
x.className = "topnav";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment