Изменения

Участник:MailGik/hilarious.js

38 байтов добавлено, 17:29, 19 августа 2016
Нет описания правки
var snowId = document.getElementById("footer");
var solfId = document.createElement("a");
solfId.setAttribute("id","gotopscroll-top");
solfId.setAttribute("title","Наверх");
snowId.appendChild(solfId);
function goTopscrollTop(){
$(window).scroll(function(e) {
//If the scroll bar at the top of more than 200 elements
if($(window).scrollTop()>200)
$("#gotopscroll-top").fadeIn(100);//In a second interval in the id=gotop scroll-top element
else
$("#gotopscroll-top").fadeOut(100);//In a second interval fade out the elements of id=gotopscroll-top
});
};
$(function(){
//Click back on top of the elements
$("#gotopscroll-top").click(function(e) {
//Return to top with second interval
$('body,html').animate({scrollTop:0},100);
});
goTopscrollTop();//The fade in and fade out back to the top element
});