1/*-----------------------------------------------------------------------------------*/ 2/* GENERAL SCRIPTS */ 3/*-----------------------------------------------------------------------------------*/ 4jQuery(document).ready(function($){ 5 6 // Fix dropdowns in Android 7 if ( /Android/i.test( navigator.userAgent ) && jQuery( window ).width() > 769 ) { 8 $( '.nav li:has(ul)' ).doubleTapToGo(); 9 } 10 11 // Table alt row styling 12 jQuery( '.entry table tr:odd' ).addClass( 'alt-table-row' ); 13 14 // FitVids - Responsive Videos 15 jQuery( '.post, .widget, .panel, .page, #featured-slider .slide-media, .slide-content' ).fitVids(); 16 17 // Add class to parent menu items with JS until WP does this natively 18 jQuery("ul.sub-menu, ul.children").parents('li').addClass('parent'); 19 20 21 // Responsive Navigation (switch top drop down for select) 22 jQuery('ul#top-nav').mobileMenu({ 23 switchWidth: 769, //width (in px to switch at) 24 topOptionText: 'Select a page', //first option text 25 indentString: ' ' //string for indenting nested items 26 }); 27 28 29 30 // Show/hide the main navigation 31 jQuery('.nav-toggle').click(function() { 32 jQuery('#navigation, .header-top .account, .header-top .cart').slideToggle('fast', function() { 33 return false; 34 // Animation complete. 35 }); 36 }); 37 38 // Stop the navigation link moving to the anchor (Still need the anchor for semantic markup) 39 jQuery('.nav-toggle a').click(function(e) { 40 e.preventDefault(); 41 }); 42 43 jQuery(function(){ 44 jQuery('.star-rating, ul.cart a.cart-contents, .cart a.remove, .added_to_cart, a.tiptip').tipTip({ 45 defaultPosition: "top", 46 delay: 0 47 }); 48 }); 49 50 // Show / hide the shipping address header on the checkout 51 $('#shiptobilling input').change(function(){ 52 $('#shiptobilling + h3').hide(); 53 if (!$(this).is(':checked')) { 54 $('#shiptobilling + h3').slideDown(); 55 } 56 }).change(); 57 58 // Only apply the fixed stuff to desktop devices 59 60 if ( ! navigator.userAgent.match(/(iPod|iPhone|iPad|Android)/)) { 61 62 // Payment box fixed 63 if (jQuery(window).width() > 768 && woo_general_params.stickyCheckout > 0) { 64 var bh = $('body').height(); 65 var pos = $('#payment').position(); 66 67 if (jQuery(window).width() > 768) { 68 $('#payment').top 69 } 70 71 $(window).scroll(function() { 72 73 var c = $(document).scrollTop(); 74 var b = $(window).height(); 75 var w = $(document).width(); 76 77 if ($(window).width() > 768){ 78 if (c > 600+pos.top){ 79 $('#payment').css('position','fixed').css('width',$('#order_review .shop_table').width()).addClass('fixed'); 80 } else { 81 $('#payment').removeAttr('style').removeClass('fixed'); 82 } 83 } else { 84 $('#payment').removeAttr('style').removeClass('fixed'); 85 } 86 // console.log(bh); 87 }); 88 $(window).resize(function(){ 89 if (jQuery(window).width() > 768) { 90 $('#payment').removeAttr('style').removeClass('fixed'); 91 } else { 92 $('#payment').css('width',$('#order_review .shop_table').width()); 93 } 94 }); 95 } 96 97 // #navigation fixed 98 if (jQuery(window).width() > 768) { 99 var bh = $('body').height(); 100 var pos = $('#navigation').position(); 101 102 if (jQuery(window).width() > 768) { 103 $('#navigation').top 104 } 105 106 $(window).scroll(function() { 107 108 var c = $(document).scrollTop(); 109 var b = $(window).height(); 110 var w = $(document).width(); 111 112 if (jQuery(window).width() > 768) { 113 if (c > 30+pos.top){ 114 $('#navigation').css('position','fixed').css('width',$('.header-top').width()).addClass('fixed'); 115 } else { 116 $('#navigation').removeAttr('style').removeClass('fixed'); 117 } 118 } else { 119 $('#navigation').removeAttr('style').removeClass('fixed'); 120 } 121 // console.log(bh); 122 }); 123 $(window).resize(function(){ 124 if (jQuery(window).width() > 768) { 125 $('#navigation').removeAttr('style').removeClass('fixed'); 126 } else { 127 $('#navigation').css('width',$('#order_review .shop_table').width()); 128 } 129 }); 130 } 131 132 } 133 134});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.