1(function($, window, document, undefined) { 2 var $win = $(window); 3 var $doc = $(document); 4 5 $doc.ready(function() { 6 // Fullsize image 7 //$('.fullsize-image').each(function() { 8 // var $holder = $(this); 9 // var imageSrc = $holder.find('img').attr('src'); 10 11 // $holder.css('background-image', 'url("' + imageSrc + '")'); 12 //}); 13 14 // Mobile Navigation 15 $('.btn-menu').on('click', function(e) { 16 e.preventDefault(); 17 18 $(this).toggleClass('active'); 19 20 $('.nav').toggleClass('expanded'); 21 22 $('.wrapper-inner').toggleClass('expanded'); 23 24 if(!$(this).hasClass('active')) { 25 $('.nav li').removeClass('expanded'); 26 } 27 }); 28 29 $('.nav a').on('click', function(e) { 30 if ($(this).siblings('ul').length ) { 31 if( $win.width() < 768 ) { 32 $(this).parent().toggleClass('expanded').siblings().removeClass('expanded'); 33 e.preventDefault(); 34 } else { 35 $(this).parent().addClass('expanded').siblings().removeClass('expanded'); 36 } 37 } 38 }); 39 40 // Placeholders - old Browsers 41 $.fn.doPlaceholders = function() { 42 if ($.support.placeholder) { 43 return this; 44 } 45 46 var $fields = this.filter(function () { 47 // Don't re-initialize 48 return !$(this).data('didPlaceholders'); 49 }); 50 51 $fields.on('focus blur', function(event) { 52 var placeholder = this.getAttribute('placeholder'); 53 54 if (event.type === 'focus' && placeholder === this.value) { 55 this.value = ''; 56 } else if (event.type === 'blur' && this.value === '') { 57 this.value = placeholder; 58 } 59 }); 60 61 // Set the initial value to the title 62 $fields.each(function() { 63 if (this.value === '') { 64 this.value = this.getAttribute('placeholder'); 65 } 66 }); 67 68 // Mark the fields as initialized 69 $fields.data('didPlaceholders', true); 70 71 // Alllow 72 return $fields; 73 }; 74 75 $.support.placeholder = (function() { 76 return 'placeholder' in document.createElement('input'); 77 })(); 78 79 /* Don't select elements if placeholder is natively supported*/ 80 if (!$.support.placeholder) { 81 $('input[placeholder], textarea[placeholder]').doPlaceholders(); 82 } 83 84 // Equalize Height 85 $.fn.equalizeHeight = function(mobile) { 86 var maxHeight = 0, itemHeight; 87 var $winW = $(window).width(); 88 89 var mobileTrue = (mobile === undefined) ? false : true; 90 91 var isMobile = $winW < 768; 92 93 for (var i = 0; i < this.length; i++) { 94 $(this[i]).css('height', 'auto'); 95 itemHeight = $(this[i]).outerHeight(); 96 97 if (maxHeight < itemHeight) { 98 maxHeight = itemHeight; 99 } 100 } 101 102 if (mobileTrue) { 103 return this.height(maxHeight); 104 } else { 105 return (!isMobile) ? this.height(maxHeight) : $(this[i]).css('height', 'auto'); 106 } 107 }; 108 109 $win.on('resize', function() { 110 $(".equalize-height").equalizeHeight(); 111 }); 112 }); 113 114 $win.on('load', function() { 115 // Slider 116 $('.slider .slides').owlCarousel({ 117 autoplay: true, 118 items: 1, 119 nav: true, 120 loop: true, 121 smartSpeed: 1100, 122 mouseDrag: false, 123 responsiveRefreshRate: 1, 124 dots: false, 125 touchDrag: true, 126 thumbs: true, 127 humbImage: true, 128 thumbContainerClass: 'owl-thumbs', 129 thumbItemClass: 'owl-thumb-item' 130 }); 131 }); 132})(jQuery, window, document); 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.