XylotrechusZ
/**
* Theme functions file
*
* Contains handlers for navigation, accessibility, header sizing
* footer widgets and Featured Content slider
*
*/
( function( $ ) {
"use strict";
// Enable menu toggle for small screens.
$(document).ready(function() {
$('.newsletterpopup .close-popup').on( "click", function(){
wpbingo_HideNLPopup();
});
$('.popupshadow').on( "click", function(){
wpbingo_HideNLPopup();
});
});
/* Show/hide NewsLetter Popup */
$( window ).load(function() {
wpbingo_ShowNLPopup();
wpbingo_verify_popup();
});
/* Function Show NewsLetter Popup */
function wpbingo_ShowNLPopup() {
if($('.newsletterpopup').length){
var cookieValue = $.cookie("vapier_lpopup");
if(cookieValue == 1) {
$('.newsletterpopup').hide();
$('.popupshadow').hide();
}else{
$('.newsletterpopup').show();
$('.popupshadow').show();
}
}
}
/* Function Hide NewsLetter Popup when click on button Close */
function wpbingo_HideNLPopup(){
$('.newsletterpopup').hide();
$('.popupshadow').hide();
if($('input:checked','.hidden-popup-newsletter').length > 0){
$.cookie("vapier_lpopup", 1, { expires : 24 * 60 * 60 * 1000 });
}
}
function wpbingo_verify_popup(){
if( $('.js-verify-popup').length ){
var verify_popup = '';
$('.js-verify-popup .button-not-allow').on('click', function() {
$.cookie("verify_popup", 'exit', { expires : 24 * 60 * 60 * 1000 });
$('.js-verify-popup').addClass('disabled');
$('.js-verify-popup .verify-info').addClass('hidden');
$('.js-verify-popup .alert-verify').removeClass('hidden');
$('body').addClass('not-scroll');
});
$('.js-verify-popup .button-allow').on('click', function() {
$.cookie("verify_popup", 'allow', { expires : 24 * 60 * 60 * 1000 });
$('.js-verify-popup').removeClass('active');
});
verify_popup = $.cookie("verify_popup");
if( !verify_popup ){
$('.js-verify-popup').addClass('active');
}else{
if( verify_popup == 'allow' ){
$('.js-verify-popup').removeClass('active');
}
if( verify_popup == 'exit' ){
$('.js-verify-popup').addClass('disabled');
$('.js-verify-popup .verify-info').addClass('hidden');
$('.js-verify-popup .alert-verify').removeClass('hidden');
$('body').addClass('not-scroll');
}
}
}
}
} )( jQuery );