OwlCyberSecurity - MANAGER
Edit File: custom.js
jQuery(document).ready(function($) { //Wrap the category in a container /*$('.single .et_pb_post, .maggie_gridblog .et_pb_post, .maggie_listblog .et_pb_post, .maggie_blogalternate .et_pb_post').each(function () { $(this).find('[rel~="tag"]').wrapAll('<div class="maggie-blog-cat"></div>'); //Move the vategory above the post title $(this).find('.maggie-blog-cat').detach().insertBefore($(".entry-title, .et_pb_slide_title", this)); });*/ // Testimonials 8 //Slide Sizes var slideaDelay = 2000; if ($('body').hasClass('et-fb')) { slideaDelay = 5000; } var tSliderWidth = ""; var tWindowWidth = ""; var tSlideItemWidth = ""; var tSlideItemCount = ""; var tMargRight = ""; var classCount = "1"; setTimeout(function () { $('.pixie_testimonials_8 .et_pb_slides').each(function () { tSliderWidth = $('.pixie_testimonials_8 .et_pb_slider').width(); tWindowWidth = $(window).width(); if (tWindowWidth >= 768) { $(this).find('.et_pb_slide').width(Math.floor(tSliderWidth / 3)); } else { $(this).find('.et_pb_slide').width(tSliderWidth); } tSlideItemWidth = $(this).find('.et_pb_slide').width(); tSlideItemCount = $(this).find('.et_pb_slide').length + 2; $(this).width(Math.floor(tSlideItemWidth) * tSlideItemCount); //console.log(tSliderWidth); //console.log(tSlideItemWidth); //console.log(tSlideItemWidth * tSlideItemCount) }); //Slider Slide $('.pixie_testimonials_8 .et-pb-controllers a').on('click', function () { setTimeout(function () { prevEl = $('.pixie_testimonials_8 .et_pb_slide.et-pb-active-slide').prevAll().length - 1; slideSize = tSlideItemWidth * prevEl - tMargRight; $('.pixie_testimonials_8 .et_pb_slides').css('margin-left', -slideSize); }, 500); }); // Auto rotate var slideInterval2 = 8000; $(function () { var timer2 = setInterval(SlideItemsPerson, slideInterval2); function SlideItemsPerson() { if ($("body:not(.et-fb) .pixie_testimonials_8 .et-pb-controllers a.et-pb-active-control").next().length != 0) { $("body:not(.et-fb) .pixie_testimonials_8 .et-pb-controllers a.et-pb-active-control").next().trigger("click"); } else { $("body:not(.et-fb) .pixie_testimonials_8 .et-pb-controllers a:first-child").trigger("click"); } } }); //Adding First and last Elements $('body:not(.et-fb) .pixie_testimonials_8 .et_pb_slide:last-child').clone().insertBefore('.pixie_testimonials_8 .et_pb_slide:first-child'); $('body:not(.et-fb) .pixie_testimonials_8 .et_pb_slide:nth-child(2)').clone().removeClass('et-pb-active-slide').insertAfter('.pixie_testimonials_8 .et_pb_slide:last-child') prevEl = $('.pixie_testimonials_8 .et_pb_slide.et-pb-active-slide').prevAll().length - 1; slideSize = tSlideItemWidth * prevEl - tMargRight; $('body:not(.et-fb) .pixie_testimonials_8 .et_pb_slides').css('margin-left', -slideSize); }, slideaDelay); // End Testimonials 8 //Replace pipes and remove commas from the meta $(".maggie_blogalternate .post-meta, .maggie_listblog .post-meta, .maggie_gridblog .post-meta, .single .post-meta, .archive #left-area .et_pb_post .post-meta").html(function () { return $(this).html().replace(/\|/g, '/').replace(/,/g, ''); }); // add button class to read more & previous & next link //$('a.more-link, .pagination .alignleft a, .pagination .alignright a').addClass('et_pb_button'); // wrap blog article elements on archive pages $('.maggie_listblog .et_pb_post, .maggie_blogalternate .et_pb_post').each(function () { $('>:not(a.entry-featured-image-url)', this).wrapAll('<div class="wrapped"></div>'); }); }); jQuery(document).ready(function($){ $(window).scroll(function(){ var topOffset = $(window).scrollTop(); var fixedSection = $('.fixed_header'); if (topOffset >= 450) { fixedSection.addClass('dl-scrolled'); } else { fixedSection.removeClass('dl-scrolled'); } }); }) jQuery(function() { jQuery(".nw-blog-43 .et_pb_post").each(function(){ jQuery(this).children().not(".entry-featured-image-url").wrapAll("<div class='description-wrap'></div>") }); jQuery(".nw-blog-43 .post-meta").each(function(){ //Add wrapper vryn-cats for the categories jQuery(this).children().not(".author").not(".published").wrapAll("<div class='vryn-cats'></div>") //Replace comma and pipe line character inside post-meta $var_meta = jQuery(this).html().replace(/,/g, '').replace(/[|]/g, ''); jQuery(this).html($var_meta); }); jQuery(document).ready(function(){ jQuery(".ie .nw-blog-43 .et_pb_post").each(function(){ var imgUrl = jQuery(this).find('img').prop('src'); jQuery(this).children('.ie .nw-blog-43 .et_pb_post .entry-featured-image-url').css('background-image', 'url(' + imgUrl + ')'); jQuery(".ie .nw-blog-43 .et_pb_post .entry-featured-image-url img").css("visibility","hidden"); jQuery(".ie .nw-blog-43 .et_pb_post .entry-featured-image-url").css({"background-size": "cover", "background-position": "center"}); }); }); }); /*jQuery(document).ready(function() { if( jQuery('body').find('.judy_bloggrid_date_row').length > 0 ){ jQuery( ".judy_bloggrid_date_row .et_pb_post").each(function( index ) { var blog_date_html = '',blog_author_html = '',cathtml='', catname ='',rel='',blog_title_html='',blog_date_data = ''; var et_pb_post = jQuery(this); blog_title_html = et_pb_post.find('.entry-title').text(); blog_date_html = et_pb_post.find('.published').text(); blog_author_html = et_pb_post.find('.author a').text(); blog_date_data = blog_date_html.split(" "); var postmeta = et_pb_post.find('.post-meta a'); postmeta.each(function( index ) { var rel = (jQuery(this).attr("rel")); if (rel.indexOf("tag") >= 0 ) { catname = (jQuery(this).text()); cathtml = '<span class="blog-category">'+catname+'</span>'; } }); et_pb_post.find('.post-meta').remove(); jQuery('<div class="post-meta"><span class="author">'+blog_author_html+'</span> <span class="category">'+cathtml+'</span></div>').insertBefore(et_pb_post.find('.entry-title')); jQuery('<div class="date"><span class="number">'+blog_date_data[1].replace(/,\s*$/, "")+'</span><span class="month">'+blog_date_data[0]+'</span></div>').insertAfter(et_pb_post.find('.et_pb_image_container img')); }); } }); */ jQuery(document).ready(function($) { $('a.video_popup, .video_popup a').magnificPopup({ type: 'iframe', mainClass: 'mfp-fade', removalDelay: 160, preloader: true, fixedContentPos: false }); }); /*Slide In Sidebar Js*/ jQuery(document).ready(function(){ jQuery(".button_trigger").click(function(){ jQuery(".slide_in_sidebar,.dct_close_btn").toggleClass("dct_activate_slide_in"); }); }); /*Slide In Sidebar Close Button Js*/ jQuery(document).ready(function(){ jQuery(".dct_close_btn").click(function(){ jQuery(".slide_in_sidebar,.dct_close_btn").removeClass("dct_activate_slide_in"); }); }); jQuery(document).ready(function($){ function ds_setup_collapsible_submenus() { var $menu = $('.et_mobile_menu'), top_level_link = '.et_mobile_menu .menu-item-has-children > a'; $menu.find('a').each(function() { $(this).off('click'); if ( $(this).is(top_level_link) ) { $(this).attr('href', '#'); } if ( ! $(this).siblings('.sub-menu').length ) { $(this).on('click', function(event) { $(this).parents('.mobile_nav').trigger('click'); }); } else { $(this).on('click', function(event) { event.preventDefault(); $(this).parent().toggleClass('visible'); }); } }); } $(window).load(function() { setTimeout(function() { ds_setup_collapsible_submenus(); }, 700); }); });