1loader.jQuery({ 2 version : '1.8.2', 3 callback : function ($) { 4 5 // Mini-cart updates 6 $.plugin('snippets', function () { 7 $.snippets('', { 8 after : function (data) { 9 var total = data['snippets']['.cartTotalItems'] || 0; 10 var cost = data['snippets']['.cartTotalCost'] || '0.00'; 11 var currency = data['snippets']['.cartCurrency'] || '$'; 12 $('.myCartLink').attr('title', total + ' Items @ ' + currency + cost); 13 } 14 }); 15 }); 16 17 // Dropdown menu controls (Superfish) 18 $.plugin('superfish', function() { 19 $(function(){ 20 $('ul.mainMenu').superfish({autoArrows: false}); 21 }); 22 }); 23 24 $.plugin('validate', function() { 25 $(function(){ 26 $("form#appointment").validate(); 27 }); 28 }); 29 30 $.plugin('fancybox', function() { 31 $(function(){ 32 $(".viewPopup").fancybox({ 33 'width': 850, 34 'height': 600, 35 'autoScale': false, 36 'transitionIn': 'none', 37 'transitionOut': 'none', 38 'type': 'iframe' 39 }); 40 $(".viewProductImages").fancybox(); 41 }); 42 }); 43 44 } 45}); 46 47(function($){ 48 $(function(){ 49 activatePushyToggle(); 50 }); 51 function activatePushyToggle() 52 { 53 if($('.mobileMenuContent li').length > 0) 54 { 55 $('.mobileMenuContent li').each(function(){ 56 if($(this).children('ul').length > 0) 57 { 58 $(this).addClass('hasChildren'); 59 $(this).children('a').append('<span class="submenuTrigger" />'); 60 } 61 }); 62 $('.mobileMenuContent li .submenuTrigger').on('click', function(e){ 63 e.preventDefault(); 64 $(this).parent().parent().toggleClass('activeItem'); 65 $(this).parent().siblings('ul').slideToggle(); 66 return false; 67 }); 68 } 69 } 70})(jQuery) 71 72$(document).ready(function() { 73 74 75// $("#theMiniCart").load("minicart.html?minicart=1&" + (new Date().getTime())); 76// $("#theMiniCart").load("/app/shop/shopfront/cart_view?minicart=1&" + (new Date().getTime())); 77// $('a#viewMiniCart').click(function(event){ 78// event.preventDefault(); 79// $('#theMiniCart').slideToggle(); 80// }); 81 82// TOP BTN 83 var offset = 200; 84 var duration = 500; 85 $(window).scroll(function() { 86 if ($(this).scrollTop() > offset) { 87 $('.scrollToTop').fadeIn(duration); 88 } else { 89 $('.scrollToTop').fadeOut(duration); 90 } 91 }); 92 $('.scrollToTop').click(function(event) { 93 event.preventDefault(); 94 $('html, body').animate({scrollTop: 0}, duration); 95 return false; 96 }) 97 98 // Email obscure 99 var _mxps1243 = 'info'; 100 _mxps1243 += '@'; 101 _mxps1243 += 'sexualhealthaustralia.com.au'; 102 $('.email a,a.email').text(_mxps1243); 103 $('.email a,a.email').prop('href','mailto:'+_mxps1243); 104 105 106// CLONE THE MENUS 107 // $('#navBlock ul.mainNav').clone().removeClass('mainMenu').addClass('mobMenu').appendTo('#mobileNav'); 108 109// RUN THE MOBILE MENUS 110 /*$('.homeBtn').on('click', function(){ 111 $('#navBlock ul.mobMenu').slideToggle(); 112 }); 113 $('#navBlock ul.mobMenu li').each(function(){ 114 if($(this).children('ul').length > 0){ 115 $(this).append('<span class="submenuTrigger">+</span>') 116 } 117 }); 118 $('.submenuTrigger').on('click', function(){ 119 $(this).siblings('ul').slideToggle(); 120 if ($(this).hasClass('active')) { 121 $(this).removeClass('active'); 122 $(this).html('+'); 123 } 124 else { 125 $(this).addClass('active'); 126 $(this).html('-'); 127 } 128 });*/ 129 130}); 131 132 133/* Thanks to CSS Tricks for pointing out this bit of jQuery 134http://css-tricks.com/equal-height-blocks-in-rows/ 135It's been modified into a function called at page load and then each time the page is resized. One large modification was to remove the set height before each new calculation. */ 136equalheight = function(container){ 137var currentTallest = 0, 138 currentRowStart = 0, 139 rowDivs = new Array(), 140 $el, 141 topPosition = 0; 142 $(container).each(function() { 143 $el = $(this); 144 $($el).height('auto') 145 topPostion = $el.position().top; 146 if (currentRowStart != topPostion) { 147 for (currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) { 148 rowDivs[currentDiv].height(currentTallest); 149 } 150 rowDivs.length = 0; // empty the array 151 currentRowStart = topPostion; 152 currentTallest = $el.height(); 153 rowDivs.push($el); 154 } else { 155 rowDivs.push($el); 156 currentTallest = (currentTallest < $el.height()) ? ($el.height()) : (currentTallest); 157 } 158 for (currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) { 159 rowDivs[currentDiv].height(currentTallest); 160 } 161 }); 162} 163$(window).load(function() { 164 equalheight('div.sameHeight'); 165}); 166$(window).resize(function(){ 167 equalheight('div.sameHeight'); 168}); 169/* MAL */ 170/* MAL */
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.