jQuery(document).ready(function($){if(location.pathname ==="/want-to-obey-housebreak/" || location.pathname ==="/want-to-obey-select/" || location.pathname ==="/want-to-obey-housebreak-mobile/" || location.pathname ==="/want-to-obey-chihuahua/" || location.pathname ==="/want-to-obey-rottweiler/" || location.pathname ==="/want-to-obey-yorkie/" || location.pathname ==="/want-to-obey-labrador/") {$('.modal_image_change').attr('src', '/wp-content/uploads/2017/03/DVD_housebreaking_noshadow.png');} $('.modal').css('height',$(document).height()); });
function calculateDParameter() { var dd = new Date(); var day = dd.getDate(); var month = dd.getMonth()+1; var year = dd.getFullYear(); var output = year+"-"+month+"-"+day; $('.todate').val(output);
var time = dd.getHours() + ":" + dd.getMinutes() + ":" + dd.getSeconds(); $('.nowtime').val(time);
var encodedString = btoa(output); $('.d_todate').val(encodedString); }
$(window).load(function() { var breed_segment = getCookie('segment'); if (breed_segment == "puppy") { $('.dogage').val("puppy"); }else{ $('.dogage').val("dog"); }
calculateDParameter();
});
// $("#subs-email").bind('keyup', function (e) { // if (e.which >= 65 && e.which <= 90) { // var newKey = e.which + 32; // // I have tried setting those // e.keyCode = newKey; // e.charCode = newKey; // } // $("#subs-email").val(($("#subs-email").val()).toLowerCase()); // });
popupNumber = 1; if(document.getElementsByClassName('popup-first-body')[1].clientHeight == 0) { popupNumber = 0; }
breedSelectPopupHeight=parseInt(document.getElementsByClassName('popup-first-body')[popupNumber].clientHeight); originalBreedSelectPopupHeight=parseInt(document.getElementsByClassName('popup-first-body')[popupNumber].clientHeight); function adjustBreedPopupPosition() {
if (window.matchMedia("(orientation: landscape)").matches) { $(".popup-first-body").removeAttr('style'); $(".popup-first-body").addClass("landscape-popup-width"); } else { popupNumber = 1; if (document.getElementsByClassName('popup-first-body')[1].clientHeight == 0) { popupNumber = 0; }
windowHeight = window.innerHeight;
console.log('windowheight--' + windowHeight); console.log('breedSelectPopupHeight--' + breedSelectPopupHeight); if (windowHeight < breedSelectPopupHeight + 3) { document.getElementsByClassName('popup-first-body')[popupNumber].style.overflowY = 'scroll'; var temporaryPopupHeight = windowHeight - 32; document.getElementsByClassName('popup-first-body')[popupNumber].style.height = temporaryPopupHeight + 'px'; //document.getElementById('popup-first-body').style.top='16px'; $("#popup-first-body").css("height", temporaryPopupHeight + "px"); //document.getElementById('popup-first-body').style.height=temporaryPopupHeight+'px'; console.log('in first ***'); } else { document.getElementsByClassName('popup-first-body')[popupNumber].style.overflowY = 'hidden'; document.getElementsByClassName('popup-first-body')[popupNumber].style.height = breedSelectPopupHeight + 'px'; var screenHeight = window.innerHeight || document.documentElement.clientHeight; var restHeight = (screenHeight - breedSelectPopupHeight) / 2; //document.getElementById('popup-first-body').style.top=restHeight+'px'; $("#popup-first-body").css("height", restHeight + "px"); console.log('in 2nd***'); } } } widthOfScreen = $(window).width(), heightOfScreen = $(window).height(); window.addEventListener("resize", function(event) { // if($(window).width() != widthOfScreen || $(window).height() != heightOfScreen){ if($(window).height() != heightOfScreen){ popupNumber = 1; if(document.getElementsByClassName('popup-first-body')[1].clientHeight == 0) { popupNumber = 0; } breedSelectPopupHeight=parseInt(document.getElementsByClassName('popup-first-body')[popupNumber].clientHeight); adjustBreedPopupPosition(); } if($(window).height() == heightOfScreen){ $(".popup-first-body").removeAttr('style'); } }); window.addEventListener("orientationchange", function() { // if((window.orientation==90) || (window.orientation == -90)) { // adjustBreedPopupPosition(); // } if(window.orientation==0) { $(".popup-first-body").removeClass("landscape-popup-width"); } }, false);