forked from veleary/Week-1-FE-Eval
-
Notifications
You must be signed in to change notification settings - Fork 0
/
easyTiger.js
31 lines (27 loc) · 1.1 KB
/
easyTiger.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
jQuery(document).ready(function($){
$(window).scroll(function(event){
var top = $(document).scrollTop();
$("#nav").toggleClass(" hide", top < 440 || top > 800);
$("#body").toggleClass(" hide", top < 200 );
$("div.1").toggleClass(" hide", top < 1000 );
$("div.2").toggleClass(" hide", top < 1300 );
$("div.3").toggleClass(" hide", top < 1600 );
$("div.4").toggleClass(" hide", top < 2200 );
$("div.5").toggleClass(" hide", top < 2600 );
$("div.6").toggleClass(" hide", top < 3000 );
$(function() {
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').stop().animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});
});
});