File: /var/www/panigaletech.com/wp-content/themes/panigale/js/custom.js
$(document).ready(function(){
$(window).scroll(function(){
if ($(this).scrollTop() > 100) {
$('#scroll').fadeIn();
} else {
$('#scroll').fadeOut();
}
});
$('#scroll').click(function(){
$("html, body").animate({ scrollTop: 0 }, 600);
return false;
});
/*Silk Slider*/
// $(".regular").slick({
// slidesToShow: 1,
// slidesToScroll: 1,
// autoplay:true,
// autoplaySpeed:3500,
// arrows:true
// });
$('.regular').slick({
draggable: true,
arrows:true,
dots: false,
fade: true,
speed: 3000,
infinite: true,
slidesToShow: 1,
lazyLoad: 'ondemand',
cssEase: 'cubic-bezier(0.5, 0, 0.3, 1)',
touchThreshold: 100,
autoplay: true,
autoplaySpeed: 1000
})
$('.latestNews').slick({
dots: true,
infinite: false,
arrows:false,
speed: 300,
slidesToShow: 2,
slidesToScroll: 2,
responsive: [
{
breakpoint: 1024,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
infinite: true,
dots: true
}
},
{
breakpoint: 600,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
},
{
breakpoint: 480,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
// You can unslick at a given breakpoint now by adding:
// settings: "unslick"
// instead of a settings object
]
});
});
/*Silk Slider*/
(function($) {
"use strict";
$('a.js-scroll-trigger[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').animate({
scrollTop: (target.offset().top - 54)
}, 1000, "easeInOutExpo");
return false;
}
}
});
$('.js-scroll-trigger').click(function() {
$('.navbar-collapse').collapse('hide');
});
$('body').scrollspy({
target: '#mainNav',
offset: 56
});
// var navbarCollapse = function() {
// if ($("#mainNav").offset().top > 200) {
// $("#mainNav").addClass("navbar-shrink");
// } else {
// $("#mainNav").removeClass("navbar-shrink");
// }
// };
// navbarCollapse();
// $(window).scroll(navbarCollapse);
})(jQuery);
$(window).scroll(function() {
//Nav Banner position
navBannerFixed();
});
$(window).resize(function(){
//Nav Banner position
navBannerFixed();
//Partners box height
//equalheight($('.why-create-account-pan'));
});
function navBannerFixed(){
//Menu fixed
var navHeight = $('.main-navigation').outerHeight();
if ($(window).scrollTop() >= navHeight +10) {
$('body').addClass('fixed-menu');
}else{
$('body').removeClass('fixed-menu');
}
}
//limit Word
$(function(){
// $(".heading01").each(function(i){
// len=$(this).text().length;
// if(len>20)
// {
// $(this).text($(this).text().substr(0,20)+'…');
// }
// });
// $(".banner-p").each(function(i){
// len=$(this).text().length;
// if(len>90)
// {
// $(this).text($(this).text().substr(0,90)+'…');
// }
// });
$(".letest-p").each(function(i){
len=$(this).text().length;
if(len>100)
{
$(this).text($(this).text().substr(0,100)+'…');
}
});
$(".news-list-text-limited").each(function(i){
len=$(this).text().length;
if(len>350)
{
$(this).text($(this).text().substr(0,350)+'…');
}
});
});