');},success: function(response) {$('.megamenuthird[data-menu=' + $data_megamenu + '-articles]').html(response);},error: function(xhr) { // if error occured$('.megamenuthird[data-menu=' + $data_megamenu + '-articles]').html("Error occured.please try again"); }});}}//Child Level Menu Hoverfunction get_childlevelmenu(currentid){//console.log('current id '+currentid);var $currentelement = $('#'+currentid);$('.menu-item-'+$('#'+currentid).closest('.themegamenu').attr('cid').split('-')[3]).removeClass('defaultajax-1');var $data_menu = $('#'+currentid).closest('li').data('menu');var ajaxreplaceContent = $('#'+currentid).closest('.themegamenu').data('megamenu')+'-articles';var submenu = $data_menu.split('-');var data_menu_class=submenu[0];//$('.megamenuthird').empty();$('.megamenuthird[data-menu=' + ajaxreplaceContent + ']').empty();$('li.level_2').removeClass('activeli');$currentelement.closest('li').siblings().removeClass('activeli');$currentelement.closest('li').addClass('activeli');var current_megamenu_second = $('.megamenusecond[data-menu='+$data_menu+']').length;$('.megamenuopen .megamenusecond').removeClass('megamenusecond-show');//$currentelement.closest('li').find('.megamenuopen .megamenusecond').removeClass('megamenusecond-show');$('.megamenusecond[data-menu=' + $data_menu + ']').addClass('megamenusecond-show');//if(current_megamenu_seconda').html();/********* End level3 checking menu ********/// checking 4th level menu /*** 4th level Objec code here **///getting parent data-menuvar levelfour_data_menu = $('.megamenusecond[data-menu='+$data_menu+']').find('li.level_3.activeli').data('menu');// End getting parent data-menuvar subofSubChildLevel_cat_id = $('.megamenusecond[data-menu='+levelfour_data_menu+']').find('li.level_4.activeli').data('cat');var subofSubChildLevel_data_menu = $('.megamenusecond[data-menu='+levelfour_data_menu+']').find('li.level_4.activeli').data('menu');var subofSubChildLevel_taxnomy_type= $('.megamenusecond[data-menu='+levelfour_data_menu+']').find('li.level_4.activeli').data('type');var subofSubChildLevel_title = $('.megamenusecond[data-menu='+levelfour_data_menu+']').find('li.level_4.activeli> a').html();if(subofSubChildLevel_title!=''){var ajx_title=subofSubChildLevel_title;}else{var ajx_title=subChildLevel_title;}/*** End 4th level Objec code here **/if(subofSubChildLevel_cat_id!=''){var data_obj ={'title':ajx_title,'subofSubChildLevel_cat_id':subofSubChildLevel_cat_id,'subofSubChildLevel_taxnomy_type':subofSubChildLevel_taxnomy_type,'subChildLevel_cat_id': subChildLevel_cat_id,'subChildLevel_taxnomy_type' :subChildLevel_taxnomy_type,'ChildLevel_data_type':ChildLevel_data_type,'ChildLevel_data_cat_id':ChildLevel_data_cat_id,'parent_data_cat_id':parent_data_cat_id,'parent_data_type':parent_data_type};}else{var data_obj ={'title':ajx_title,'subChildLevel_cat_id': subChildLevel_cat_id,'subChildLevel_taxnomy_type' :subChildLevel_taxnomy_type,'ChildLevel_data_type':ChildLevel_data_type,'ChildLevel_data_cat_id':ChildLevel_data_cat_id,'parent_data_cat_id':parent_data_cat_id,'parent_data_type':parent_data_type};}} if( ajaxRequestProject != null ) {ajaxRequestProject.abort();ajaxRequestProject = null;}ajaxRequestProject = $.ajax({type: 'POST',url: 'https://pharmaceutical-business-review.com/wp-admin/admin-ajax.php?action=mega_posts',data: data_obj, dataType: "html",beforeSend: function() {$('.megamenuthird[data-menu=' + ajaxreplaceContent+ ']').html('');},success: function(response) {$('.megamenuthird[data-menu=' + ajaxreplaceContent + ']').html(response);},error: function(xhr) { // if error occured$('.megamenuthird[data-menu=' + ajaxreplaceContent + ']').html("Error occured.please try again");}});}//Subchild Level Menu Hover//Child Level Menu Hoverfunction get_subchildlevelmenu(currentid){var $currentelement = $('#'+currentid);$('.menu-item-'+$('#'+currentid).closest('.themegamenu').attr('cid').split('-')[3]).removeClass('defaultajax-1');var $data_menu = $currentelement.closest('li').attr('data-menu'); var submenu = $data_menu.split('-'); var data_menu_class=submenu[0];var ajaxreplaceContent = $('#'+currentid).closest('.themegamenu').data('megamenu')+'-articles';$('.megamenuthird[data-menu=' + ajaxreplaceContent + ']').empty();$('.megamenuthird').removeClass('megamenuthird-show');$('.megamenuthird[data-menu=' + $data_menu + ']').addClass('megamenuthird-show');$('li.level_3').removeClass('activeli');$currentelement.closest('li').addClass('activeli');var subChildLevel_title = $currentelement.html();//last child level$currentelement.closest('li').parent().closest('li').find('.megamenusecond-new[data-menu=' + $data_menu + ']').find('li.level_4').removeClass('activeli');var $data_menu = $('#'+currentid).closest('li').data('menu');$('.megamenuopen .megamenusecond-new').removeClass('megamenusecond-show');$currentelement.closest('li').parent().closest('li').find('.megamenusecond-new[data-menu=' + $data_menu + ']').addClass('megamenusecond-show');$currentelement.closest('li').parent().closest('li').find('.megamenusecond-new[data-menu=' + $data_menu + ']').find('li.level_4:first-child').addClass('activeli');//console.log('subchild-'+title);var subChildLevel_cat_id=$currentelement.closest('li').data("cat");var subChildLevel_taxnomy_type = $currentelement.closest('li').data("type");var ChildLevel_data_type= $(".mega-options > li.project_m.activeli").data("type");var ChildLevel_data_cat_id= $(".mega-options > li.project_m.activeli").data("cat_id");var parent_data_cat_id= $currentelement.closest('.themegamenu').data("main_cat_id");var parent_data_type= $currentelement.closest('.themegamenu').data("main_type");// checking 4th level menu /*** 4th level Objec code here **/// End getting parent data-menuif($('.megamenusecond.megamenusecond-new').length > 0){var subofSubChildLevel_cat_id = $('.megamenusecond[data-menu='+$data_menu+']').find('li.level_4.activeli').data('cat');var subofSubChildLevel_data_menu = $('.megamenusecond[data-menu='+$data_menu+']').find('li.level_4.activeli').data('menu');var subofSubChildLevel_taxnomy_type= $('.megamenusecond[data-menu='+$data_menu+']').find('li.level_4.activeli').data('type');var subofSubChildLevel_title = $('.megamenusecond[data-menu='+$data_menu+']').find('li.level_4.activeli> a').html();if(subofSubChildLevel_title!==''){var ajx_title=subofSubChildLevel_title;}else{var ajx_title=subChildLevel_title;}if(subofSubChildLevel_cat_id!=''){var data_obj= {'title':ajx_title,'subofSubChildLevel_cat_id':subofSubChildLevel_cat_id,'subofSubChildLevel_taxnomy_type':subofSubChildLevel_taxnomy_type,'subChildLevel_cat_id': subChildLevel_cat_id,'subChildLevel_taxnomy_type' :subChildLevel_taxnomy_type,'ChildLevel_data_type':ChildLevel_data_type,'ChildLevel_data_cat_id':ChildLevel_data_cat_id,'parent_data_cat_id':parent_data_cat_id,'parent_data_type':parent_data_type};}else{var data_obj= {'title':ajx_title,'subChildLevel_cat_id': subChildLevel_cat_id,'subChildLevel_taxnomy_type' :subChildLevel_taxnomy_type,'ChildLevel_data_type':ChildLevel_data_type,'ChildLevel_data_cat_id':ChildLevel_data_cat_id,'parent_data_cat_id':parent_data_cat_id,'parent_data_type':parent_data_type};}}else{var data_obj= {'title':subChildLevel_title,'subChildLevel_cat_id': subChildLevel_cat_id,'subChildLevel_taxnomy_type' :subChildLevel_taxnomy_type,'ChildLevel_data_type':ChildLevel_data_type,'ChildLevel_data_cat_id':ChildLevel_data_cat_id,'parent_data_cat_id':parent_data_cat_id,'parent_data_type':parent_data_type};} if( ajaxRequestProject != null ) {ajaxRequestProject.abort();ajaxRequestProject = null;}ajaxRequestProject = $.ajax({ type: 'POST', url: 'https://pharmaceutical-business-review.com/wp-admin/admin-ajax.php?action=mega_posts', dataType: "html", data: data_obj, beforeSend: function() {$('.megamenuthird[data-menu=' + ajaxreplaceContent + ']').html('');},success: function(response) {$('.megamenuthird[data-menu=' + ajaxreplaceContent + ']').html(response);},error: function(xhr) { // if error occured$('.megamenuthird[data-menu=' + ajaxreplaceContent + ']').html("Error occured.please try again"); }});}//last child levelfunction get_lastchildlevelmenu(currentid){var $currentelement = $('#'+currentid);$('.menu-item-'+$('#'+currentid).closest('.themegamenu').attr('cid').split('-')[3]).removeClass('defaultajax-1');var $data_menu = $currentelement.closest('li').attr('data-menu'); var submenu = $data_menu.split('-'); var data_menu_class=submenu[0];var $ajax_data_menu = $currentelement.closest('li').attr('data-ajax'); var ajax_submenu = $ajax_data_menu.split('-'); var ajax_data_menu_class=ajax_submenu[0]+'-'+ajax_submenu[1];var ajaxreplaceContent = $('#'+currentid).closest('.themegamenu').data('megamenu')+'-articles';$('.megamenuthird[data-menu=' + ajaxreplaceContent + ']').empty();$('.megamenuthird').removeClass('megamenuthird-show');$('.megamenuthird[data-menu=' + $data_menu + ']').addClass('megamenuthird-show');$('li.level_4').removeClass('activeli');$currentelement.closest('li').addClass('activeli');var title = $currentelement.html();var subofSubChildLevel_cat_id=$currentelement.closest('li').data("cat");var subofSubChildLevel_taxnomy_type = $currentelement.closest('li').data("type");var subofSubChildLevel_title = $currentelement.closest('li').find('li.level_4.activeli> a').html();var subChildLevel_cat_id=$('.megamenusecond[data-menu='+ajax_data_menu_class+']').find('li.level_3.activeli').data('cat');var subChildLevel_data_menu=$('.megamenusecond[data-menu='+ajax_data_menu_class+']').find('li.level_3.activeli').data('menu');var subChildLevel_taxnomy_type = $('.megamenusecond[data-menu='+ajax_data_menu_class+']').find('li.level_3.activeli').data('type');var ChildLevel_data_type= $(".mega-options > li.project_m.activeli").data("type");var ChildLevel_data_cat_id= $(".mega-options > li.project_m.activeli").data("cat_id");var parent_data_cat_id= $currentelement.closest('.themegamenu').data("main_cat_id");var parent_data_type= $currentelement.closest('.themegamenu').data("main_type");var data_obj= {'title':title,'subofSubChildLevel_cat_id':subofSubChildLevel_cat_id,'subofSubChildLevel_taxnomy_type':subofSubChildLevel_taxnomy_type,'subChildLevel_cat_id': subChildLevel_cat_id,'subChildLevel_taxnomy_type' :subChildLevel_taxnomy_type,'ChildLevel_data_type':ChildLevel_data_type,'ChildLevel_data_cat_id':ChildLevel_data_cat_id,'parent_data_cat_id':parent_data_cat_id,'parent_data_type':parent_data_type};if( ajaxRequestProject != null ) {ajaxRequestProject.abort();ajaxRequestProject = null;}ajaxRequestProject = $.ajax({ type: 'POST', url: 'https://pharmaceutical-business-review.com/wp-admin/admin-ajax.php?action=mega_posts', dataType: "html", data:data_obj, beforeSend: function() {$('.megamenuthird[data-menu=' + ajaxreplaceContent + ']').html('');},success: function(response) {$('.megamenuthird[data-menu=' + ajaxreplaceContent + ']').html(response);},error: function(xhr) { // if error occured$('.megamenuthird[data-menu=' + ajaxreplaceContent + ']').html("Error occured.please try again"); }});} $(document).ready(function(){//$('body').addClass('loaded');/********* End Third Level on over show/hide ****/$('.news-box-big').hover(function() {$(this).closest('.news').children('.big_title').toggleClass("bordertop");});$('.news-box-medium').hover(function() {$(this).closest('.medium_title').children('.tbt').toggleClass("bordertop");}); /********* Newsletter onclick events start here *******/ $(".header-cta a").click(function(e){ var $elem = $('.newsletter-box').position(); $('html,body').animate({ scrollTop: $(".newsletter-box").offset().top - 80}, 'fast'); }); /***** Newsletter onclick events End here *******/ /* Close guided tour */ $(".close-guided-tour").click(function(){$(".home_timeline").hide(); }); /* Close guided tour */ $(".close-guided-tour2").click(function(){ $(".timeline-tour2").hide(); }); /* $( ".fa-search" ).click(function() { $( 'body' ).toggleClass('search-open'); //$('.search-form').toggle(); }); $('.search-toggle').click(function () {$('.search-form').toggleClass('expanded');}); */ // Search toggle$('.navbar .search-toggle, .mobilesearch').click(function(e){e.preventDefault();$(this).parent().toggleClass('active').find('input[type="search"]').focus();});$('.search-submit').click(function(e){if( $(this).parent().find('.search-field').val() == '' ) {e.preventDefault();$(this).parent().parent().removeClass('active');}}); }); /* Reached newsletter */ $(function(){ $(document).scroll(function(){ if($(this).scrollTop() > = $('.email-capture').offset().top - 50) { $('body').addClass("email-capture-reached"); } else{ $('body').removeClass("email-capture-reached"); } if($(this).scrollTop() > = $('.timeline').offset().top - 50) { $('body').addClass("timeline-tour-open"); } else{ $('body').removeClass("timeline-tour-open"); } }); }); /****** Article page Share n/w ********/ $('.social-toggle').on('click', function() { $(this).next().toggleClass('open-menu'); }); /*** End Article page Share n/w ********/ /* Close guided tour */ $(".close-guided-tour2").click(function(){ $("body").addClass("timeline-closed"); }); /* End Timeline guided tour Track the news */ /* Reached related headline */ $(function(){ $(document).ready(function(){ $('body').addClass("headline-reached"); }); }); /* Reached start */ /*$(function(){ $(document).scroll(function(){ if($(this).scrollTop() > = $('#start').offset().top - 50) { $('body').addClass("start-reached"); } else{ $('body').removeClass("start-reached"); } }); });*/ /* Reached share-content */ $(function(){ $(document).scroll(function(){ if($(this).scrollTop() > = $('.share-content').offset().top - 50) { $('body').addClass("share-content-reached"); } else{ $('body').removeClass("share-content-reached"); } }); }); /* share copy-link section */ function myFunction() { var copyText = document.getElementById("copylink"); copyText.select(); document.execCommand("Copy"); } /* Reached first sidebar mpu */ $(function(){ $(document).scroll(function(){ if($(this).scrollTop() > = $('.mpu1').offset().top - 50) { $('body').addClass("reached-mpu1"); } else{ $('body').removeClass("reached-mpu1"); } }); }); /* Sticky sidebar banner */ /* $(function(){ $(document).scroll(function(){ if ($(window).width() > 1400) { if($(this).scrollTop() > = $('#sticky-mpu').offset().top - 250 ) { $('.sidebar').addClass("banner-fixed"); } else{ $('.sidebar').removeClass("banner-fixed"); } } }); });*/ // Select all links with hashes $('a[href*="#"]') // Remove links that don't actually link to anything .not('[href="#"]') .not('[href="#0"]') .click(function(event) { // On-page links if ( location.pathname.replace(/^//, '') == this.pathname.replace(/^//, '') && location.hostname == this.hostname ) { // Figure out element to scroll to var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); // Does a scroll target exist? if (target.length) { // Only prevent default if animation is actually gonna happen event.preventDefault(); $('html, body').animate({ scrollTop: target.offset().top }, 1000, function() { // Callback after animation // Must change focus! var $target = $(target); $target.focus(); if ($target.is(":focus")) { // Checking if the target was focused return false; } else { $target.attr('tabindex','-1'); // Adding tabindex for elements not focusable $target.focus(); // Set focus again }; }); } } }); /******** onclick share button in catgeory page ******/ $(".share-button").click(function(){ if($(this).parent('.open-share').length == 0){ $('.share').removeClass('open-share'); $(this).parent('.share').addClass("open-share"); }else{ $('.share').removeClass('open-share'); } }); /************* Mobile menu js *******/ function openNav() { document.getElementById("mobilemenu").style.width = "100%"; document.getElementById("mobilemenu").style.left = "0px"; } function closeNav() { document.getElementById("mobilemenu").style.width = "0"; } $( ".mobilemenuicon" ).click(function() { setTimeout(function(){ $( '.mobile-menu-cta' ).addClass("mobilectashow"); }, 500); }); $( ".closebtn" ).click(function() { $( '.mobile-menu-cta' ).removeClass("mobilectashow") }); /********** End mobile menu js *******/ /********* contractors Single page close Header**/ $(".close_section").click(function(){ $('.headersf').hide(1000); $('.headersf').addClass('section_closed'); $('.header-singleproduct').addClass('margin_top_added'); $('.small_header_sf').addClass('small_header_sf_display'); }); /******* End contractors Single page close Header**/ /*** My accout drop down menu */ $('.ctanav .dropdown-menu a').on('click', function() { window.location.href = $(this).attr('href'); }); /*** cookie-popup **/ $("#cookiepopup-continue").click(function(){ $.cookie("cookie_compelo", 'https://pharmaceutical-business-review.com'); $('.home_timeline').hide(); }); $(window).on("load",function(){ var data = $.cookie("cookie_compelo"); if(data){ $('.home_timeline').hide(); }else{ $('.home_timeline').show(); } }); $(".home_timeline .close").click(function(){ $.cookie("cookie_compelo", 'https://pharmaceutical-business-review.com'); $('.home_timeline').hide(); }); $(window).on("load",function(){ var data = $.cookie("cookie_compelo"); if(data){ $('.home_timeline').hide(); }else{ $('.home_timeline').show(); } }); /*** End cookie popup **/ /**** New add js code ***/ if ($(window).width() > 960) { // Initialization $(function(){ $('[data-scroll-speed]').moveIt(); }); } /* Sticky sidebar banner EVENT PAGE */ $(function(){ $(document).scroll(function(){ var scroll = $(window).scrollTop(); if (scroll > = 655) { $('.sticky-mpu-event').addClass("banner-fixed"); } else{ $('.sticky-mpu-event').removeClass("banner-fixed"); } }); }); //advertising page jQuery.fn.moveIt = function(){ var $window = jQuery(window); var instances = []; jQuery(this).each(function(){ instances.push(new moveItItem($(this))); }); window.addEventListener('scroll', function(){ var scrollTop = $window.scrollTop(); instances.forEach(function(inst){ inst.update(scrollTop); }); }, {passive: true}); } var moveItItem = function(el){ this.el = jQuery(el); this.speed = parseInt(this.el.attr('data-scroll-speed')); }; moveItItem.prototype.update = function(scrollTop){ this.el.css('transform', 'translateY(' + -(scrollTop / this.speed) + 'px)');};// InitializationjQuery(function(){jQuery('[data-scroll-speed]').moveIt();}); /**** end new add js code **/
Recent Comments