(function ($) {
"use strict";
jQuery(document).ready(function($){
// showcase slider
$('.showcase_slider').owlCarousel({
loop:true,
autoHeight: true,
autoplay: true,
nav: false,
margin:0,
responsive:{
0:{
items:2
},
600:{
items:4
},
1000:{
items:6
}
}
});
//bootstrap carousel
$('.carousel').carousel({
pause: true,
interval: 2000
});
// start vertical lightslider
$('#vertical').lightSlider({
gallery:true,
item:1,
vertical:true,
verticalHeight:320,
vThumbWidth:100,
thumbItem:4,
thumbMargin:15,
enableDrag: true,
slideMargin:0
});
// end vertical lightslider
$("a").on('click', function(event) {
// Make sure this.hash has a value before overriding default behavior
if (this.hash !== "") {
// Prevent default anchor click behavior
event.preventDefault();
// Store hash
var hash = this.hash;
// Using jQuery's animate() method to add smooth page scroll
// The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
$('html, body').animate({
scrollTop: $(hash).offset().top
}, 800, function(){
// Add hash (#) to URL when done scrolling (default click behavior)
window.location.hash = hash;
});
} // End if
});
// start normal lightslider
var scrollTop = $(".scrollTop");
$(window).scroll(function() {
// declare variable
var topPos = $(this).scrollTop();
// if user scrolls down - show scroll to top button
if (topPos > 100) {
$(scrollTop).css("opacity", "1");
} else {
$(scrollTop).css("opacity", "0");
}
}); // scroll END
//Click event to scroll to top
$(scrollTop).click(function() {
$('html, body').animate({
scrollTop: 0
}, 800);
return false;
}); // click() scroll top EMD
/*************************************
LEFT MENU SMOOTH SCROLL ANIMATION
*************************************/
// declare variable
var h1 = $("#h1").position();
var h2 = $("#h2").position();
var h3 = $("#h3").position();
$('.link1').click(function() {
$('html, body').animate({
scrollTop: h1.top
}, 500);
return false;
}); // left menu link2 click() scroll END
$('.link2').click(function() {
$('html, body').animate({
scrollTop: h2.top
}, 500);
return false;
}); // left menu link2 click() scroll END
$('.link3').click(function() {
$('html, body').animate({
scrollTop: h3.top
}, 500);
return false;
}); // left menu link3 click() scroll
$('#image-gallery').lightSlider({
gallery:true,
item:1,
thumbItem:6,
slideMargin: 0,
thumbMargin:24,
verticalHeight:600,
vThumbWidth:100,
speed:500,
auto:true,
loop:true,
onSliderLoad: function() {
$('#image-gallery').removeClass('cS-hidden');
}
});
// end normal lightslider
})
/** start prelaoder js **/
$(window).load(function() { // makes sure the whole site is loaded
$('#status').fadeOut(); // will first fade out the loading animation
$('#loader-wrapper').delay(300).fadeOut('slow'); // will fade out the white DIV that covers the website.
$('body').delay(350).css({'overflow-x':'hidden'});
})
/** end prelaoder js **/
}(jQuery)); |