Update script.js
This commit is contained in:
+42
-32
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
$(window).load(function(){
|
$(window).load(function(){
|
||||||
$(".loader").fadeOut(4000);
|
$(".loader").fadeOut(100);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -17,22 +17,56 @@ $(window).scroll(
|
|||||||
function () {
|
function () {
|
||||||
var currentTop = $(window).scrollTop();
|
var currentTop = $(window).scrollTop();
|
||||||
if (currentTop < 900) {
|
if (currentTop < 900) {
|
||||||
$(".sidebar em").text("Up"); /* optional for demo */
|
$(".header").fadeIn("medium");
|
||||||
$(".header").show("fast");
|
|
||||||
}
|
}
|
||||||
else if (currentTop < this.previousTop) {
|
else if (currentTop < this.previousTop) {
|
||||||
$(".sidebar em").text("Up"); /* optional for demo */
|
$(".header").fadeIn("medium");
|
||||||
$(".header").show("fast");
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$(".sidebar em").text("Down");
|
$(".header").fadeOut("medium");
|
||||||
$(".header").hide("fast");
|
|
||||||
}
|
}
|
||||||
this.previousTop = currentTop;
|
this.previousTop = currentTop;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*-------------Parallax--------------*/
|
||||||
|
|
||||||
|
$(window).scroll(function(){
|
||||||
|
|
||||||
|
var wScroll = $(this).scrollTop();
|
||||||
|
|
||||||
|
$('.cover').css({
|
||||||
|
'transform' : 'translate(0px, '+ wScroll /16 +'%)'
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.cover1').css({
|
||||||
|
'transform' : 'translate(0px, -'+ wScroll /15 +'%)'
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.music1').css({
|
||||||
|
'transform' : 'translate(0px, '+ wScroll /3 +'%)'
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$('.mushroom').css({
|
||||||
|
'transform' : 'translate(0px, -'+ wScroll /20 +'%)'
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.mario').css({
|
||||||
|
'transform' : 'translate('+ wScroll /10 +'%, '+ wScroll /30 +'%)'
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.joystick').css({
|
||||||
|
'transform' : 'translate(0px, '+ wScroll /20 +'%)'
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
/*-----------Smooth Scroll from clicking on link in navbar-----*/
|
/*-----------Smooth Scroll from clicking on link in navbar-----*/
|
||||||
|
|
||||||
$(function(){
|
$(function(){
|
||||||
@@ -49,31 +83,7 @@ $(function(){
|
|||||||
|
|
||||||
|
|
||||||
}, 'slow');
|
}, 'slow');
|
||||||
|
return false;
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*-------------Parallax--------------*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(window).scroll(function(){
|
|
||||||
|
|
||||||
var wScroll = $(this).scrollTop();
|
|
||||||
|
|
||||||
$('.cover').css({
|
|
||||||
'transform' : 'translate(0px, '+ wScroll /16 +'%)'
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.cover1').css({
|
|
||||||
'transform' : 'translate(0px, -'+ wScroll /15 +'%)'
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.music1').css({
|
|
||||||
'transform' : 'translate(0px, '+ wScroll /4 +'%)'
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user