Ha-ha
This commit is contained in:
15
house/main.js
Executable file
15
house/main.js
Executable file
@ -0,0 +1,15 @@
|
||||
$(function() {
|
||||
$('#logo').click(function() {
|
||||
$('nav').toggleClass('opened')
|
||||
});
|
||||
$(".link").click(function (event) {
|
||||
event.preventDefault();
|
||||
var id = $(this).attr('href'),
|
||||
top = $(id).offset().top,
|
||||
time = Math.abs(window.pageYOffset - top) * 2;
|
||||
if(window.innerHeight > window.innerWidth){
|
||||
time = 1500;
|
||||
}
|
||||
$('body,html').animate({scrollTop: top}, time);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user