AlkantarClanX12
| Current Path : /var/www/clients/client1/web1/web/sites/all/themes/hawell/js/ |
| Current File : /var/www/clients/client1/web1/web/sites/all/themes/hawell/js/update.js |
(function($) {
"use strict"; // Start of use strict
/* Section Background */
$('.image_bck').each(function(){
var image = $(this).attr('data-image');
var gradient = $(this).attr('data-gradient');
var color = $(this).attr('data-color');
var blend = $(this).attr('data-blend');
var opacity = $(this).attr('data-opacity');
var position = $(this).attr('data-position');
if (image){
$(this).css('background-image', 'url('+image+')');
}
if (gradient){
$(this).css('background-image', gradient);
}
if (color){
$(this).css('background-color', color);
}
if (blend){
$(this).css('background-blend-mode', blend);
}
if (position){
$(this).css('background-position', position);
}
if (opacity){
$(this).css('opacity', opacity);
}
});
$('.page-section').each(function(){
var color = $(this).attr('data-color');
if (color){
$(this).css('background-color', color);
}
});
})(jQuery);
jQuery(document).ready(function($) {
$('.widget.block-search form').append('<span aria-hidden="true" class="icon_search"></span>');
$('.navbar.navbar-default form').append('<span aria-hidden="true" class="icon_search"></span>');
//JS onepage menu
if ($('#main-menu nav > ul').hasClass('one-menu') == true) {
$('.page-section').each(function(index, el) {
var menu_title = $(this).attr('data-title');
var menu_id = $(this).attr('id');
if (menu_title && menu_id) {
var li = '<li><a href="#'+menu_id+'">'+menu_title+'</a></li>';
$('#main-menu nav > ul').append(li);
}
});
}
//ONE PAGE NAV ---------------------------------------------------------------------------
var top_offset = $('header').height() - 1; // get height of fixed navbar
$('#nav-onepage').onePageNav({
currentClass: 'current',
changeHash: false,
scrollSpeed: 700,
scrollOffset: top_offset,
scrollThreshold: 0.5,
filter: '',
easing: 'swing',
begin: function() {
//I get fired when the animation is starting
},
end: function() {
//I get fired when the animation is ending
},
scrollChange: function($currentListItem) {
//I get fired when you enter a section and I pass the list item of the section
}
});
//MAIN MENU
$('ul.nav.navbar-nav > li').each(function(index, el) {
if ($(this).find('> a').hasClass('active')) {
$(this).addClass('current');
}
});
$('ul.nav.navbar-nav > li > .sub > li').each(function(index, el) {
if ($(this).find('> a').hasClass('active')) {
$(this).parent().parent().addClass('current');
$(this).find('> a').addClass('current');
}
});
$('ul.nav.navbar-nav > li > .sub > li > .sub > li').each(function(index, el) {
if ($(this).find('> a').hasClass('active')) {
$(this).parent().parent().parent().parent().addClass('current');
$(this).find('> a').addClass('current');
$(this).parent().parent().find('> a').addClass('current');
}
});
$('ul.nav.navbar-nav > li.megamenu').each(function(index, el) {
var menu = '<li><div class="menu-sub-container">';
var k = $(this).find('> .sub > li').length;
for (var i = 1; i <= k; i++) {
var title = $(this).find('> .sub > li:nth-child('+i+') >a').text();
var class_sub_menu = $(this).find('> .sub > li:nth-child('+i+') >a').attr('class');
var menu_sub = $(this).find('> .sub > li:nth-child('+i+') > .sub ').html();
menu += '<div class="box '+class_sub_menu+' nofloat closed"><h5 class="title">'+title+'</h5>';
menu += '<ul>'+menu_sub+'</ul></div>';
};
menu += '</div></li>';
$(this).find('> .sub').html(menu);
});
//NAV SIDEBAR------------------------------------------------------------------
var top_offset = $('header').height() - 1; // get height of fixed navbar
$('#nav-sidebar').onePageNav({
currentClass: 'current',
changeHash: false,
scrollSpeed: 700,
scrollOffset: top_offset,
scrollThreshold: 0.5,
filter: '',
easing: 'swing',
begin: function() {
//I get fired when the animation is starting
},
end: function() {
//I get fired when the animation is ending
},
scrollChange: function($currentListItem) {
//I get fired when you enter a section and I pass the list item of the section
}
});
//SIDEBAR STICKY---------------------------------------------
var //offsetSb = $('.page-title-bg').height(),
offsetFooter = $('#footer-offset').height() + 30;
// DM Menu
jQuery('#sidebar-stiky').affix({
offset: {
top: 300, //top offset for header 1 for others headers it will have other value
bottom: offsetFooter
}
});
//COUNTDOWN -----------------------------------------------------------------------------
var $countdown = jQuery('#clock').attr('data-countdown');
jQuery('#clock').countdown($countdown).on('update.countdown', function(event) {
var $this = $(this).html(event.strftime('' + '<div class="col-xs-12 col-sm-6 col-md-3"><div class="countdown-item-container"><span class="countdown-amount">%D</span><span class="countdown-period">day%!D</span></div></div>' + '<div class="col-xs-12 col-sm-6 col-md-3"><div class="countdown-item-container"><span class="countdown-amount">%H</span><span class="countdown-period">hour%!H</span></div></div>' + '<div class="col-xs-12 col-sm-6 col-md-3"><div class="countdown-item-container"><span class="countdown-amount">%M</span><span class="countdown-period">minute%!M</span></div></div>' + '<div class="col-xs-12 col-sm-6 col-md-3"><div class="countdown-item-container"><span class="countdown-amount">%S</span><span class="countdown-period">second%!S</span></div></div>'));
});
var $countdown2 = jQuery('#clock2').attr('data-countdown');
$('#clock2').countdown($countdown2).on('update.countdown', function(event) {
var $this = $(this).html(event.strftime('' + '<div class="col-xs-12 col-sm-6 col-md-3"><div class="countdown-item-container2"><span class="countdown-amount">%D</span><span class="countdown-period">day%!D</span></div></div>' + '<div class="col-xs-12 col-sm-6 col-md-3"><div class="countdown-item-container2"><span class="countdown-amount">%H</span><span class="countdown-period">hour%!H</span></div></div>' + '<div class="col-xs-12 col-sm-6 col-md-3"><div class="countdown-item-container2"><span class="countdown-amount">%M</span><span class="countdown-period">minute%!M</span></div></div>' + '<div class="col-xs-12 col-sm-6 col-md-3"><div class="countdown-item-container2"><span class="countdown-amount">%S</span><span class="countdown-period">second%!S</span></div></div>'));
});
});