/**
* JS for Bloggers Lite theme
*/
(function ($) {
function sticky_header() {
if ($('body').hasClass('sticky-header')) {
var start_y = $('.top-header').innerHeight() + 60;
var window_y = $(window).scrollTop();
if (window_y > 10) {
if (!($('#masthead').hasClass('is-sticky'))) {
$('#masthead .top-header').slideUp(100);
$('#masthead')
.addClass('is-sticky');
}
} else {
if ($('#masthead').hasClass('is-sticky')) {
$('#masthead .top-header').slideDown(100);
$('#masthead').removeClass('is-sticky');
}
}
}
}
$(document).ready(function () {
//$('.site-header.stricky').meanmenu();
//$('.home .site-header .menu-block').meanmenu();
$('.site-header.stricky-menu-left').meanmenu();
$('.site-header.stricky-menu-right').meanmenu();
$('.home .site-header .menu-block.stricky-menu-left').meanmenu();
$('.home .site-header .menu-block.stricky-menu-right').meanmenu();
//$('.site-header').meanmenu();
/*----------------Go to top----------------------------*/
/*----------------Go to top----------------------------*/
$(".arrow-up").click(function () {
$("html, body").animate({scrollTop: 0}, 1000);
});
/*---------------------------------------------------------------------*/
/*---------------------script for GO TO TOP button--------------------*/
$(window).scroll(function () {
var scroll = $(window).scrollTop();
if (scroll > 100) {
$(".arrow-up").fadeIn();
} else {
$(".arrow-up").fadeOut();
}
});
$('#site-navigation ul ul').each(function () {
if ($(this).children().length) {
$(this, 'li:first').before('');
}
});
$('a.menu-expand').click(function (e) {
e.preventDefault();
if ($(this).find("i").hasClass("fa-caret-down")) {
$(this).find("i").removeClass("fa-caret-down");
$(this).find("i").addClass("fa-caret-up");
} else {
$(this).find("i").removeClass("fa-caret-up");
$(this).find("i").addClass("fa-caret-down");
}
$(this).siblings('ul').slideToggle(".sub-menu");
});
$('.slick_slider ul.slides').slick({
dots: false,
infinite: true,
slidesToShow: 1,
slidesToScroll: 1,
autoplaySpeed: 3000,
autoplay: true,
prevArrow: '
',
nextArrow: '
'
});
$('.menu-scroll-down').click(function (e) {
var $scrollTop = $("#primary").offset().top - 50;
e.preventDefault();
$('html, body').animate({
scrollTop: $scrollTop
}, 600);
});
});
$('.our_client_div').slick({
slidesToShow: 5,
dots: true,
slidesToScroll: 1,
autoplay: true,
autoplaySpeed: 2000,
responsive: [
{
breakpoint: 1100,
settings: {
slidesToShow: 4,
slidesToScroll: 1,
infinite: true,
dots: true
}
},
{
breakpoint: 1023,
settings: {
slidesToShow: 3,
slidesToScroll: 1
}
},
{
breakpoint: 480,
settings: {
slidesToShow: 2,
slidesToScroll: 1
}
},
{
breakpoint: 360,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
]
});
//Issue for last menu with submenu
$("ul.nav-menu li.menu-item-has-children").on('mouseenter mouseleave', function (e) {
var elm = $(this).children('ul');
var off = elm.offset();
var l = off.left;
var container_left = $('.container').offset().left;
var container_width = $('.container').width();
var w = elm.width();
var isEntirelyVisible = (l + w <= container_width + container_left);
if (!isEntirelyVisible) {
$(this).addClass('edge');
} else {
$(this).removeClass('edge');
}
});
})(jQuery);
/*-------Scrolling Effects-------*/
jQuery(function ($) {
var $elems = $('.animateblock');
var winheight = $(window).height();
var fullheight = $(document).height();
$elems.each(function () {
var $elm = $(this);
var topcoords = $elm.offset().top;
if (topcoords < winheight) {
// animate when top of the window is 3/4 above the element
$elm.addClass('animated');
}
});
$('.progress_inner').each(function () {
if ($(this).offset().top < winheight)
{
var width = $(this).attr('data-width');
$(this).animate({
width: width
}, 1000);
}
});
$('.pie_progress').each(function () {
if ($(this).offset().top < winheight)
{
$(this).asPieProgress('start');
}
});
$(window).scroll(function () {
animate_elems();
});
function animate_elems() {
var wintop;
wintop = $(window).scrollTop(); // calculate distance from top of window
// loop through each item to check when it animates
$elems.each(function () {
var $elm = $(this);
if ($elm.hasClass('animated')) {
return true;
} // if already animated skip to the next item
var topcoords = $elm.offset().top; // element's distance from top of page in pixels
if (wintop > (topcoords - (winheight * 0.9))) {
// animate when top of the window is 3/4 above the element
$elm.addClass('animated');
}
});
$('.progress_inner').each(function () {
if (wintop > $(this).offset().top - winheight)
{
var width = $(this).attr('data-width');
$(this).animate({
width: width
}, 500);
}
});
}
});
/* --------------- Scrolling Effects end ------------ */
jQuery(window).load(function ($) {
/* ------------Portfolio isotop effect start------------------ */
var transitionDuration = 200;
var columnWidth = 400;
jQuery('#category_menu_ul li a').removeClass('category_menu_selected');
var current_cat_with_hash = window.location.hash;
if (current_cat_with_hash != '')
{
var cat_slug_arr = current_cat_with_hash.split('#');
var cat_slug = cat_slug_arr[1];
jQuery('.' + cat_slug + ' a').addClass('category_menu_selected');
if (cat_slug == 'show_all')
{
console.log();
} else
{
$container.isotope({filter: '.' + cat_slug});
jQuery('.page-numbers').each(function () {
var cur_link = jQuery(this).attr('href');
if (typeof cur_link !== typeof undefined && cur_link !== false) {
var pag_l = jQuery(this).attr('href').split('#');
if (pag_l != '')
{
jQuery(this).attr('href', pag_l[0] + current_cat_with_hash);
} else
{
jQuery(this).attr('href', cur_link + current_cat_with_hash);
}
} else
{
jQuery(this).attr('href', current_cat_with_hash);
}
});
}
} else
{
jQuery('.show_all a').addClass('category_menu_selected');
}
jQuery('#category_menu_ul').on('click', 'li', function () {
jQuery('#category_menu_ul li a').removeClass('category_menu_selected');
jQuery(this).children('a').addClass('category_menu_selected');
var filterValue = jQuery(this).attr('data-filter');
var curclass = jQuery(this).attr('class');
window.location.hash = curclass;
$container.isotope({filter: filterValue});
var page_q = jQuery(this).children('a').attr('href');
jQuery('.page-numbers').each(function () {
var cur_link = jQuery(this).attr('href');
if (typeof cur_link !== typeof undefined && cur_link !== false) {
var pag_l = jQuery(this).attr('href').split('#');
if (pag_l != '')
{
jQuery(this).attr('href', pag_l[0] + page_q);
} else
{
jQuery(this).attr('href', cur_link + page_q);
}
} else
{
jQuery(this).attr('href', page_q);
}
});
});
/* ------------Portfolio isotop effect end------------------ */
//custum_header_hight();
});
function custum_header_hight() {
var asd = jQuery(window).height();
alert(asd);
}