File "main.js"
Full Path: /home/flipjqml/onlinebetsolution.com/wp-content/themes/cyarb/assets/js/main.js
File size: 9.4 KB
MIME-type: text/plain
Charset: utf-8
(function($){
"use strict";
jQuery(document).on('ready', function () {
// Mean Menu
$('.mean-menu').meanmenu({
meanScreenWidth: "991"
});
// Header Sticky
$(window).on('scroll',function() {
if ($(this).scrollTop() > 120){
$('.navbar-area').addClass("is-sticky");
}
else{
$('.navbar-area').removeClass("is-sticky");
}
});
// Others Option For Responsive JS
$(".others-option-for-responsive .dot-menu").on("click", function(){
$(".others-option-for-responsive .container .container").toggleClass("active");
});
// Search Menu JS
$(".others-option .search-icon i").on("click", function(){
$(".search-overlay").toggleClass("search-overlay-active");
});
$(".search-overlay-close").on("click", function(){
$(".search-overlay").removeClass("search-overlay-active");
});
// Odometer JS
$('.odometer').appear(function(e) {
var odo = $(".odometer");
odo.each(function() {
var countNumber = $(this).attr("data-count");
$(this).html(countNumber);
});
});
// Popup Image
$('.popup-image').magnificPopup({
type: 'image',
gallery:{
enabled:true
}
});
// Popup Video
$('.popup-video').magnificPopup({
disableOn: 320,
type: 'iframe',
mainClass: 'mfp-fade',
removalDelay: 160,
preloader: false,
fixedContentPos: false
});
// Country Select
$("#country_selector, #country_selector2").countrySelect({
preferredCountries: ['ca', 'gb', 'us']
});
// TweenMax JS
$('.main-banner-area').mousemove(function(e){
var wx = $(window).width();
var wy = $(window).height();
var x = e.pageX - this.offsetLeft;
var y = e.pageY - this.offsetTop;
var newx = x - wx/2;
var newy = y - wy/2;
$('.main-banner-image').each(function(){
var speed = $(this).attr('data-speed');
if($(this).attr('data-revert')) speed *= -.4;
TweenMax.to($(this), 1, {x: (1 - newx*speed), y: (1 - newy*speed)});
});
});
// Product +/-
$(".plus-btn").on('click', function() {
var input = $(this).prev('input.qty');
var val = parseInt(input.val());
var step = input.attr('step');
step = 'undefined' !== typeof(step) ? parseInt(step) : 1;
input.val( val + step ).change();
});
$(".minus-btn").on('click', function() {
var input = $(this).next('input.qty');
var val = parseInt(input.val());
var step = input.attr('step');
step = 'undefined' !== typeof(step) ? parseInt(step) : 1;
if (val > 0) {
input.val( val - step ).change();
}
});
// Products Details Image Slides
$('.products-details-thumbs-image-slides').slick({
dots: true,
speed: 500,
fade: false,
slide: 'li',
slidesToShow: 1,
autoplay: true,
autoplaySpeed: 4000,
prevArrow: false,
nextArrow: false,
responsive: [{
breakpoint: 800,
settings: {
arrows: false,
centerMode: false,
centerPadding: '30px',
variableWidth: false,
slidesToShow: 1,
dots: true
},
breakpoint: 1200,
settings: {
arrows: false,
centerMode: false,
centerPadding: '30px',
variableWidth: false,
slidesToShow: 1,
dots: true
}
}],
customPaging: function (slider, i) {
return '<button class="tab">' + $('.slick-thumbs li:nth-child(' + (i + 1) + ')').html() + '</button>';
}
});
// Go to Top
$(function(){
// Scroll Event
$(window).on('scroll', function(){
var scrolled = $(window).scrollTop();
if (scrolled > 600) $('.go-top').addClass('active');
if (scrolled < 600) $('.go-top').removeClass('active');
});
// Click Event
$('.go-top').on('click', function() {
$("html, body").animate({ scrollTop: "0" }, 500);
});
});
// partner-carousel
var partnerOwl = $('.partner-carousel');
partnerOwl.owlCarousel({
loop: true,
margin: 20,
nav: false,
dots: false,
animateIn: 'fadeIn',
animateOut: 'fadeOut',
autoplay: true,
autoplayTimeout: 3000,
smartSpeed: 1500,
responsive:{
0: {
items: 2
},
600: {
items: 2
},
768: {
items: 3
},
1000: {
items: 4
}
}
});
});
$( window ).on( 'elementor/frontend/init', function() {
elementorFrontend.hooks.addAction( 'frontend/element_ready/widget', function( $scope ) {
// Home Slides
$('.home-slides').owlCarousel({
items: 1,
margin: 0,
nav: true,
loop: true,
dots: false,
autoplay: true,
animateIn: 'fadeIn',
animateOut: 'fadeOut',
autoplayHoverPause: true,
navText: [
"<i class='lni lni-chevron-left'></i>",
"<i class='lni lni-chevron-right'></i>",
]
});
// Feedback Slides
$('.feedback-slides').owlCarousel({
nav: false,
margin: 25,
dots: true,
loop: true,
autoplay: false,
autoplayHoverPause: true,
navText: [
"<i class='lni lni-chevron-left'></i>",
"<i class='lni lni-chevron-right'></i>",
],
responsive: {
0: {
items: 1
},
576: {
items: 1
},
768: {
items: 2
},
992: {
items: 2
},
1200: {
items: 3
}
}
});
$('.feedback-slides-two').owlCarousel({
nav: false,
margin: 25,
dots: true,
loop: true,
autoplay: false,
autoplayHoverPause: true,
navText: [
"<i class='lni lni-chevron-left'></i>",
"<i class='lni lni-chevron-right'></i>",
],
responsive: {
0: {
items: 1
},
576: {
items: 1
},
768: {
items: 2
},
992: {
items: 2
},
1200: {
items: 2
}
}
});
// Services Slides
$('.services-slides').owlCarousel({
nav: false,
margin: 25,
dots: true,
loop: true,
autoplay: false,
autoplayHoverPause: true,
navText: [
"<i class='lni lni-chevron-left'></i>",
"<i class='lni lni-chevron-right'></i>",
],
responsive: {
0: {
items: 1
},
576: {
items: 1
},
768: {
items: 2
},
992: {
items: 2
},
1200: {
items: 3
}
}
});
// partner-carousel
var partnerOwl = $('.partner-carousel');
partnerOwl.owlCarousel({
loop: true,
margin: 20,
nav: false,
dots: false,
animateIn: 'fadeIn',
animateOut: 'fadeOut',
autoplay: true,
autoplayTimeout: 3000,
smartSpeed: 1500,
responsive:{
0: {
items: 2
},
600: {
items: 2
},
768: {
items: 3
},
1000: {
items: 4
}
}
});
// Resources Slides
$('.resources-slides').owlCarousel({
nav: false,
dots: true,
margin: 25,
loop: true,
center: true,
autoplay: false,
autoplayHoverPause: true,
navText: [
"<i class='lni lni-chevron-left'></i>",
"<i class='lni lni-chevron-right'></i>",
],
responsive: {
0: {
items: 1
},
576: {
items: 1
},
768: {
items: 2
},
992: {
items: 2
},
1200: {
items: 3
}
}
});
// New Demo JS
// New Main Banner Slides
$('.new-main-home-slides').owlCarousel({
loop: true,
nav: false,
dots: false,
thumbs: true,
thumbsPrerendered: true,
animateOut: 'fadeOut',
autoplayHoverPause: true,
autoHeight:true,
autoplay: true,
items: 1,
});
// Safer World Slides
$('.safer-world-slides').owlCarousel({
nav: true,
margin: 25,
dots: false,
loop: true,
autoplay: true,
autoplayHoverPause: true,
center: true,
stagePadding: 100,
navText: [
"<i class='lni lni-chevron-left'></i>",
"<i class='lni lni-chevron-right'></i>",
],
responsive: {
0: {
items: 1,
stagePadding: 10
},
576: {
items: 1,
stagePadding: 10
},
768: {
items: 2,
stagePadding: 10
},
992: {
items: 2
},
1200: {
items: 3
}
}
});
// Testimonials Slides
$('.testimonials-slides').owlCarousel({
loop: true,
nav: false,
dots: true,
autoplayHoverPause: true,
autoHeight:true,
autoplay: true,
items: 1,
margin: 25,
});
// Get Privacy Slides
$('.get-privacy-slides').owlCarousel({
nav: true,
margin: 25,
dots: false,
loop: true,
autoplay: true,
autoplayHoverPause: true,
navText: [
"<i class='lni lni-chevron-left'></i>",
"<i class='lni lni-chevron-right'></i>",
],
responsive: {
0: {
items: 1
},
576: {
items: 1
},
768: {
items: 2
},
992: {
items: 2
},
1200: {
items: 4
}
}
});
// Partner Slides
$('.partner-slides').owlCarousel({
nav: false,
margin: 25,
dots: false,
loop: true,
autoplay: true,
autoplayHoverPause: true,
responsive: {
0: {
items: 2
},
576: {
items: 2
},
768: {
items: 3
},
992: {
items: 4
},
1200: {
items: 5
}
}
});
// New Main Banner Wrap Slides
$('.new-main-home-wrap-slides').owlCarousel({
items: 1,
margin: 0,
nav: true,
loop: true,
dots: false,
autoplay: true,
animateIn: 'fadeIn',
animateOut: 'fadeOut',
autoplayHoverPause: true,
navText: [
"<i class='lni lni-chevron-left'></i>",
"<i class='lni lni-chevron-right'></i>",
]
});
});
});
}(jQuery));