if (!empty($enable_top_bar)) { ?> top-bar-enabled<?php } else { ?> top-bar-disabled<?php } ?> <?php if (is_page_template('page-header-tansparent.php') || is_page_template('page-header-tansparent-2.php') || !empty($enable_transparent_header_background_for_blog) && !empty($header_background_for_blog) && mega_is_blog() || !empty($enable_transparent_header_background_for_blog) && !empty($header_background_for_blog) && is_search() || !empty($enable_transparent_header_background_for_blog) && !empty($header_background_for_blog) && is_404() || !empty($enable_transparent_header_background_for_shop) && !empty($header_background_for_shop) && is_shop() || !empty($enable_transparent_header_background_for_shop) && !empty($header_background_for_shop) && is_product_category() || !empty($enable_transparent_header_background_for_shop) && !empty($header_background_for_shop) && is_product_tag() || !empty($enable_transparent_header_background_for_single_portfolio_pages) && $post_type == 'portfolio' || !empty($optiontree_enable_transparent_header_background_for_single_portfolio_pages)) { ?> transparent-header<?php } ?> <?php if (!empty($header_background_for_blog) && mega_is_blog() || !empty($header_background_for_blog) && is_search() || !empty($header_background_for_blog) && is_404() || !empty($header_background_for_shop) && is_shop() || !empty($header_background_for_shop) && is_product_category() || !empty($header_background_for_shop) && is_product_tag() || !empty($enable_transparent_header_background_for_single_portfolio_pages) && $post_type == 'portfolio' || !empty($optiontree_enable_transparent_header_background_for_single_portfolio_pages)) { ?> big-header-enabled<?php } ?> "> <!-- Head ================================================== --> <?php if (!empty($enable_top_bar)) { ?> <section id="top-bar-wrapper"> <div id="top-bar" class="clearfix"> <?php $enable_shopping_cart_on_woocommerce_pages_only = ot_get_option('enable_shopping_cart_on_woocommerce_pages_only');
/** * Initialize jQuery Plugins. */ function mega_initialize_jquery_plugins() { ?> <!-- JavaScript ================================================== --> <?php global $wp_the_query; $pageid = $wp_the_query->get_queried_object_id(); $mediaType = get_post_meta($pageid, 'mega_portfolio_type', true); //$mediaType = get_post_meta( get_the_ID(), 'mega_portfolio_type', true ); ?> <?php $left_menu = ot_get_option('left_menu'); ?> <?php if (empty($left_menu)) { ?> <?php $header_style = ot_get_option('header_style'); ?> <?php if (empty($header_style)) { ?> <?php $header_style = 'fixed'; ?> <?php } ?> <?php $remove_header_height_reduction = ot_get_option('remove_header_height_reduction'); ?> <?php if ($header_style == 'fixed') { ?> <?php //if ( empty( $remove_header_height_reduction ) ) { ?> <script> // Transition jQuery(document).ready(function($) { if(!(/Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/i).test(navigator.userAgent || navigator.vendor || window.opera)){ var $addTransition = $( '#header, .site-title-custom, #site-title, .site-title-custom img, #access, .search-header-wrapper, .social-accounts-wrapper, .woocommerce-cart-wrapper, #header-wrapper #s, #header-wrapper .info-header' ); $addTransition.addClass( 'transition' ); } }); </script> <?php //} ?> <script> // Sticky header //if(!(/Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/i).test(navigator.userAgent || navigator.vendor || window.opera)){ var sticky = document.querySelector('#header-wrapper'); var origOffsetY = sticky.offsetTop; var hasScrollY = 'scrollY' in window; function onScroll(e) { var y = hasScrollY ? window.scrollY : document.documentElement.scrollTop; y >= origOffsetY ? sticky.classList.add('fixed') : sticky.classList.remove('fixed'); } if (document.addEventListener) { document.addEventListener('scroll', onScroll); } else if (document.attachEvent) { document.attachEvent('onscroll', onScroll); } //} </script> <?php $header_background_for_blog = ot_get_option('header_background_for_blog'); ?> <?php $header_background_for_shop = ot_get_option('header_background_for_shop'); ?> <?php global $post_type; ?> <?php $enable_transparent_header_background_for_single_portfolio_pages = ot_get_option('enable_transparent_header_background_for_single_portfolio_pages'); ?> <?php $optiontree_enable_transparent_header_background_for_single_portfolio_pages = get_post_meta(get_the_ID(), 'optiontree_enable_transparent_header_background_for_single_portfolio_pages', true); ?> <?php $enable_transparent_header_background_for_blog = ot_get_option('enable_transparent_header_background_for_blog'); ?> <?php $enable_transparent_header_background_for_shop = ot_get_option('enable_transparent_header_background_for_shop'); ?> <?php if (is_page_template('page-header-tansparent.php') || !empty($enable_transparent_header_background_for_blog) && !empty($header_background_for_blog) && mega_is_blog() || !empty($enable_transparent_header_background_for_shop) && !empty($header_background_for_shop) && is_shop() || !empty($enable_transparent_header_background_for_shop) && !empty($header_background_for_shop) && is_product_category() || !empty($enable_transparent_header_background_for_shop) && !empty($header_background_for_shop) && is_product_tag() || !empty($enable_transparent_header_background_for_single_portfolio_pages) && $post_type == 'portfolio' || !empty($optiontree_enable_transparent_header_background_for_single_portfolio_pages)) { ?> <script> jQuery(document).ready(function($) { // Transparent Header Background for Homepage //if(!(/Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/i).test(navigator.userAgent || navigator.vendor || window.opera)){ var sticky = $('#header-wrapper').offset().top; var page = $('#page'); $(window).scroll(function(){ if( $(window).scrollTop() > sticky ) { page.removeClass('transparent-header'); } else { page.addClass('transparent-header'); } }); //} }); </script> <?php } ?> <?php } // End if ( $header_style == 'fixed' ) ?> <?php } // End if ( empty( $left_menu ) ) ?> <?php $page_load_progress_bar = ot_get_option('page_load_progress_bar'); ?> <?php if (!empty($page_load_progress_bar)) { ?> <script> // Pace jQuery(document).ready(function($) { Pace.on("done", function(){ $("#page").css({'opacity' : '1', 'visibility' : 'visible'}); }); }); </script> <?php } ?> <script> // FlexSlider jQuery(window).load(function() { jQuery('.flex-direction-nav a').html(''); }); </script> <?php $disable_right_click = ot_get_option('disable_right_click'); ?> <?php if (!empty($disable_right_click)) { ?> <script> jQuery(window).load(function() { jQuery('img, .tp-bgimg, .rsImg').bind("contextmenu", function (e) { return false; /* Disables right click */ }); }); </script> <?php } ?> <?php $javascript_code = ot_get_option('javascript_code'); ?> <?php if (!empty($javascript_code)) { ?> <?php echo $javascript_code; ?> <?php } ?> <?php global $woocommerce; ?> <?php if ($woocommerce) { ?> <?php if (is_shop() || is_product_category()) { ?> <script> jQuery(document).ready(function($) { if(!(/Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/i).test(navigator.userAgent || navigator.vendor || window.opera)){ $('.chosen-select-no-single').chosen({ disable_search_threshold: 10 }); } else { $('.chosen-select-no-single').css({'opacity' : '1', 'width' : '100%', 'height' : 'auto'}); } }); </script> <?php } ?> <?php } ?> <?php }