| Server IP : 27.254.86.99 / Your IP : 216.73.216.234 Web Server : LiteSpeed System : Linux wp1.hostneverdie.com 4.18.0-553.46.1.lve.el8.x86_64 #1 SMP Wed Apr 2 11:16:45 UTC 2025 x86_64 User : qtccargo ( 1078) PHP Version : 8.2.29 Disable Function : apache_child_terminate, apache_setenv, define_syslog_variables, escapeshellarg, escapeshellcmd,exec, fp, fput, highlight_file, ini_alter, ini_restore, inject_code, passthru,phpAds_remoteInfo, phpAds_XmlRpc,phpAds_xmlrpcDecode, phpAds_xmlrpcEncode, popen, posix_getpwuid, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid,posix_setuid, posix_setuid, posix_uname,proc_open,proc_close, proc_get_status, proc_nice, proc_terminate, shell_exec, syslog, system, xmlrpc_entity_decode, show_source,pcntl_exec,virtual,suexec,dbmopen,dl,disk_free_space,diskfreespace,leak MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/qtccargo/public_html/wp-content/themes/cargohub/js/ |
Upload File : |
var cargohub = cargohub || {};
(function ($) {
'use strict';
$(function () {
var $body = $('body'),
$window = $(window),
$header = $('#masthead'),
$mobileNav = $('#primary-mobile-nav'),
headerTransparent = $('.header-transparent .site-header'),
$listProject = $('.post-type-archive-project .content-area .list-project');
// Back to top scroll
$window.scroll(function () {
if ($(window).scrollTop() > $(window).height()) {
$('#scroll-top').addClass('show-scroll');
} else {
$('#scroll-top').removeClass('show-scroll');
}
});
// Scroll effect button top
$('#scroll-top').on('click', function (event) {
event.preventDefault();
$('html, body').stop().animate({
scrollTop: 0
},
1200
);
});
galleryPopUp();
function galleryPopUp() {
$('.gallery').each(function () {
var $gallery = $(this);
$gallery.find('.gallery-item a').attr('rel', $gallery.attr('id')).addClass('fancybox');
});
$('.fancybox').fancybox({
openEffect : 'none',
closeEffect: 'none'
});
}
$window.on('resize', function () {
var hHeader,
hTopbar,
scrollTop;
if ($window.width() < 1200 && $body.hasClass('hide-topbar-mobile')) {
hTopbar = 0;
} else {
hTopbar = $('.topbar').outerHeight(true);
}
if ($body.hasClass('admin-bar')) {
headerTransparent.css({
'top': hTopbar + 32
});
$('.header-v4 .site-header').css({
'top': hTopbar + 32
});
} else {
headerTransparent.css({
'top': hTopbar
});
$('.header-v4 .site-header').css({
'top': hTopbar
});
}
$window.on('scroll', function () {
if ($window.width() < 1200 && $body.hasClass('hide-topbar-mobile')) {
hTopbar = 0;
} else {
hTopbar = $('.topbar').outerHeight(true);
}
scrollTop = hTopbar;
if ($body.hasClass('header-v4') || $body.hasClass('header-v3')) {
scrollTop = hTopbar + $('.site-contact').outerHeight(true);
}
if ($window.scrollTop() > scrollTop) {
$header.addClass('minimized');
$('#fh-header-minimized').addClass('minimized');
} else {
$header.removeClass('minimized');
$('#fh-header-minimized').removeClass('minimized');
}
});
if ($body.hasClass('header-v3') && $window.width() > 1199) {
hHeader = $('.site-menu').outerHeight(true);
} else {
hHeader = $header.outerHeight(true);
}
if ($body.hasClass('header-sticky')) {
$('#fh-header-minimized').height(hHeader);
}
}).trigger('resize');
/**
* Filter project category
*/
$(window).load(function () {
$('.fh-latest-project').find('.list-project').isotope({
itemSelector: '.project',
layoutMode : 'fitRows'
});
$('ul.filter li.active').trigger('click');
});
$('ul.filter').on('click', 'li', function (e) {
e.preventDefault();
var $this = $(this),
selector = $this.attr('data-option-value');
if ($this.hasClass('active')) {
return;
}
// Archive
$this.closest('.filters-dropdown').next('.list-project').isotope({
filter: selector
});
$this.addClass('active').siblings('.active').removeClass('active');
});
$listProject.imagesLoaded(function () {
var args = {
itemSelector : '.project-wrapper',
percentPosition: true
};
if ($body.hasClass('project-mansony')) {
args.masonry = {
columnWidth: '.project-sizer'
};
}
$listProject.isotope(args);
});
// Product qty change
$body.on('click', '.quantity .increase, .quantity .decrease', function (e) {
e.preventDefault();
var $this = $(this),
$qty = $this.siblings('.qty'),
current = parseInt($qty.val(), 10),
min = parseInt($qty.attr('min'), 10),
max = parseInt($qty.attr('max'), 10);
max = max ? max : current + 1;
if ($this.hasClass('decrease') && current > min) {
$qty.val(current - 1);
$qty.trigger('change');
}
if ($this.hasClass('increase') && current < max) {
$qty.val(current + 1);
$qty.trigger('change');
}
});
$('.project-carousel').owlCarousel({
rtl : true,
items : 1,
loop : true,
navSpeed : 800,
nav : false,
dots : true,
autoPlay : true,
dotsSpeed: 1000,
navText : ['<i class="fa fa-chevron-left" aria-hidden="true"></i>', '<i class="fa fa-chevron-right" aria-hidden="true"></i>']
});
//Section Parallax
var $pageHeader = $('.page-header .header-title');
for (var i = 0; i < $pageHeader.length; i++) {
$($pageHeader[i]).parallax('50%', 0.6);
}
$('.post-type-archive-project').find('.numeric-navigation').on('click', '.page-numbers.next', function (e) {
e.preventDefault();
if ($(this).data('requestRunning')) {
return;
}
$(this).data('requestRunning', true);
$(this).addClass('loading');
var $project = $(this).parents('.numeric-navigation').prev('.list-project'),
$pagination = $(this).parents('.numeric-navigation');
$.get(
$(this).attr('href'),
function (response) {
var content = $(response).find('.list-project').html(),
$pagination_html = $(response).find('.numeric-navigation').html();
var $content = $(content);
$pagination.html($pagination_html);
if ($body.hasClass('project-nav-ajax')) {
$content.imagesLoaded(function () {
$project.isotope('insert', $content);
$pagination.find('.page-numbers.next').removeClass('loading');
});
} else {
$project.append($content);
$pagination.find('.page-numbers.next').removeClass('loading');
}
$pagination.find('.page-numbers.next').data('requestRunning', false);
}
);
});
/**
* Hide cart or nav when click to off canvas layer
*/
$('#off-canvas-layer').on('click', function (e) {
e.preventDefault();
$body.removeClass('display-mobile-menu');
});
/**
* Off canvas cart toggle
*/
$body.on('click', '.navbar-toggle', function (e) {
e.preventDefault();
$(this).toggleClass('selected-mobile');
$body.toggleClass('display-mobile-menu');
});
$('ul.menu li.menu-item-has-children a').addClass('dropdown-toggle');
$body.on('click', '#toggle-search', function (e) {
e.preventDefault();
$(this).parents('.topbar-search').toggleClass('display-search');
});
$body.on('click', '.menu-item-search .toggle-search', function (e) {
e.preventDefault();
$(this).parents('.menu-item-search').toggleClass('display-search');
});
// Menu Mobile
menuMobile();
function menuMobile() {
$mobileNav.find('.menu .menu-item-has-children').prepend('<span class="toggle-children "><i class="fa fa-angle-right" aria-hidden="true"></i></span>');
$mobileNav.find('.menu .menu-item-has-children').each(function () {
var title = '';
if ($(this).children('a').hasClass('dropdown-toggle')) {
title = $(this).children('.dropdown-toggle').html();
}
$(this).children('ul').prepend('<li class="menu-parent-items">' + title + '</li>');
$(this).children('ul').prepend('<li class="menu-back">' + cargohub.cargohub_back + '</li>');
});
$mobileNav.find('.menu .menu-item-has-children').on('click', '.toggle-children', function (e) {
e.preventDefault();
$(this).parent('li').addClass('over-menu');
$(this).parents('.menu').addClass('over-submenu');
});
$mobileNav.find('.menu .menu-item-has-children').on('click', '.menu-back', function (e) {
e.preventDefault();
$(this).closest('ul').closest('li').removeClass('over-menu');
if (!$mobileNav.find('.menu .menu-item-has-children').hasClass('over-menu')) {
$mobileNav.find('.menu').removeClass('over-submenu');
}
});
$mobileNav.on('click', '.close-canvas-mobile-panel', function (e) {
e.preventDefault();
$body.toggleClass('display-mobile-menu');
});
}
widgetOffice();
function widgetOffice() {
var $tabs = $('.office-location .office-switcher ul li'),
$first = $tabs.filter(':first'),
$current = $('.office-location .office-switcher a'),
$content = $('.office-location .topbar-office');
$first.addClass('active');
$content.filter(':first').addClass('active');
$current.html($first.html());
$current.on('click', function (e) {
var $this = $(this);
e.preventDefault();
$this.parent().toggleClass('show-office');
});
$tabs.on('click', function () {
var $this = $(this),
tab_id = $this.attr('data-tab');
if ($this.hasClass('active')) {
return;
}
$current.html($this.html());
$current.parent().toggleClass('show-office');
$tabs.removeClass('active');
$content.removeClass('active');
$this.addClass('active');
$('#' + tab_id).addClass('active');
});
}
});
})(jQuery);
;