Update niggascript.js
This commit is contained in:
@@ -1,19 +1,41 @@
|
|||||||
|
|
||||||
|
/*----------------loading screen disappears---------*/
|
||||||
|
|
||||||
|
|
||||||
|
$(window).load(function(){
|
||||||
|
$(".loader").fadeOut(4000);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*---------hide and showing of navbar with scroll up and down-----*/
|
||||||
|
|
||||||
$(window).scroll(
|
$(window).scroll(
|
||||||
{
|
{
|
||||||
previousTop: 900
|
previousTop: 0
|
||||||
},
|
},
|
||||||
function () {
|
function () {
|
||||||
var currentTop = $(window).scrollTop();
|
var currentTop = $(window).scrollTop();
|
||||||
if (currentTop < this.previousTop) {
|
if (currentTop < 900) {
|
||||||
$(".sidebar em").text("Up"); /* optional for demo */
|
$(".sidebar em").text("Up"); /* optional for demo */
|
||||||
$(".header").show();
|
$(".header").show("fast");
|
||||||
}
|
}
|
||||||
|
else if (currentTop < this.previousTop) {
|
||||||
|
$(".sidebar em").text("Up"); /* optional for demo */
|
||||||
|
$(".header").show("fast");
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
$(".sidebar em").text("Down");
|
$(".sidebar em").text("Down");
|
||||||
$(".header").hide();
|
$(".header").hide("fast");
|
||||||
}
|
}
|
||||||
this.previousTop = currentTop;
|
this.previousTop = currentTop;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*-----------Smooth Scroll from clicking on link in navbar-----*/
|
||||||
|
|
||||||
$(function(){
|
$(function(){
|
||||||
$('a[href^="#"]').click(function(e){
|
$('a[href^="#"]').click(function(e){
|
||||||
var target = $(this).attr('href');
|
var target = $(this).attr('href');
|
||||||
@@ -32,3 +54,29 @@ $(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*-------------Parallax--------------*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$(window).scroll(function(){
|
||||||
|
|
||||||
|
var wScroll = $(this).scrollTop();
|
||||||
|
|
||||||
|
$('.cover').css({
|
||||||
|
'transform' : 'translate(0px, '+ wScroll /10 +'%)'
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.cover1').css({
|
||||||
|
'transform' : 'translate(0px, -'+ wScroll /15 +'%)'
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.music').css({
|
||||||
|
'transform' : 'translate(0px, -'+ wScroll /15 +'%)'
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user