1 2/***** Don't remove !! *******/ 3 4/*jQuery(document).foundation();*/ 5 6/***** Custom Scripts !! *******/ 7 8jQuery(document).ready(function() { 9 10 if(window.matchMedia("(max-width: 767px)").matches){ 11 jQuery('table').wrap('<div style="overflow-x:auto;"></div>'); 12 /* jQuery('table td img').wrap('<div style="position:relative; width:100%; height:100%;min-height: 7.25rem; min-width: 7rem;"></div>');*/ 13 console.log('Siamo in mobile'); 14 } 15 16 17 jQuery( '#example1' ).sliderPro({ 18 width: '100%', 19 height: 343, 20 arrows: true, 21 buttons: false, 22 waitForLayers: true, 23 thumbnailWidth: 200, 24 thumbnailHeight: 100, 25 thumbnailPointer: true, 26 autoplay: false, 27 autoScaleLayers: false, 28 }); 29 30 /* Animation for submenu */ 31 32 jQuery('.chooose_nav li.menu-item-has-children > a').removeAttr( "href" ); 33 34 35 /* Correction for responsvie youtube video */ 36 37 // Find all YouTube videos 38var $allVideos = jQuery("iframe[src^='//www.youtube.com']"), 39 40 // The element that is fluid width 41 $fluidEl = jQuery("body"); 42 43// Figure out and save aspect ratio for each video 44$allVideos.each(function() { 45 46 jQuery(this) 47 .data('aspectRatio', this.height / this.width) 48 49 // and remove the hard coded width/height 50 .removeAttr('height') 51 .removeAttr('width'); 52 53}); 54 55// When the window is resized 56jQuery(window).resize(function() { 57 58 var newWidth = $fluidEl.width(); 59 60 // Resize all videos according to their own aspect ratio 61 $allVideos.each(function() { 62 63 var $el = jQuery(this); 64 $el 65 .width(newWidth) 66 .height(newWidth * $el.data('aspectRatio')); 67 68 }); 69 70// Kick off one resize to fix all videos on page load 71}).resize(); 72 73 74 75/* MAps */ 76 77(function($) { 78 79/* 80* new_map 81* 82* This function will render a Google Map onto the selected jQuery element 83* 84* @type function 85* @date 8/11/2013 86* @since 4.3.0 87* 88* @param $el (jQuery element) 89* @return n/a 90*/ 91 92function new_map( $el ) { 93 94 // var 95 var $markers = $el.find('.marker'); 96 97 98 // vars 99 var args = { 100 zoom : 16, 101 center : new google.maps.LatLng(0, 0), 102 mapTypeId : google.maps.MapTypeId.ROADMAP 103 }; 104 105 106 // create map 107 var map = new google.maps.Map( $el[0], args); 108 109 110 // add a markers reference 111 map.markers = []; 112 113 114 // add markers 115 $markers.each(function(){ 116 117 add_marker( $(this), map ); 118 119 }); 120 121 122 // center map 123 center_map( map ); 124 125 126 // return 127 return map; 128 129} 130 131/* 132* add_marker 133* 134* This function will add a marker to the selected Google Map 135* 136* @type function 137* @date 8/11/2013 138* @since 4.3.0 139* 140* @param $marker (jQuery element) 141* @param map (Google Map object) 142* @return n/a 143*/ 144 145function add_marker( $marker, map ) { 146 147 // var 148 var latlng = new google.maps.LatLng( $marker.attr('data-lat'), $marker.attr('data-lng') ); 149 150 // create marker 151 var marker = new google.maps.Marker({ 152 position : latlng, 153 map : map 154 }); 155 156 // add to array 157 map.markers.push( marker ); 158 159 // if marker contains HTML, add it to an infoWindow 160 if( $marker.html() ) 161 { 162 // create info window 163 var infowindow = new google.maps.InfoWindow({ 164 content : $marker.html() 165 }); 166 167 // show info window when marker is clicked 168 google.maps.event.addListener(marker, 'click', function() { 169 170 infowindow.open( map, marker ); 171 172 }); 173 } 174 175} 176 177/* 178* center_map 179* 180* This function will center the map, showing all markers attached to this map 181* 182* @type function 183* @date 8/11/2013 184* @since 4.3.0 185* 186* @param map (Google Map object) 187* @return n/a 188*/ 189 190function center_map( map ) { 191 192 // vars 193 var bounds = new google.maps.LatLngBounds(); 194 195 // loop through all markers and create bounds 196 $.each( map.markers, function( i, marker ){ 197 198 var latlng = new google.maps.LatLng( marker.position.lat(), marker.position.lng() ); 199 200 bounds.extend( latlng ); 201 202 }); 203 204 // only 1 marker? 205 if( map.markers.length == 1 ) 206 { 207 // set center of map 208 map.setCenter( bounds.getCenter() ); 209 map.setZoom( 16 ); 210 } 211 else 212 { 213 // fit to bounds 214 map.fitBounds( bounds ); 215 } 216 217} 218 219/* 220* document ready 221* 222* This function will render each map when the document is ready (page has loaded) 223* 224* @type function 225* @date 8/11/2013 226* @since 5.0.0 227* 228* @param n/a 229* @return n/a 230*/ 231// global var
232var map = null; 233 234jQuery(document).ready(function(){ 235 236 jQuery('.acf-map').each(function(){ 237 238 // create map 239 map = new_map( $(this) ); 240 241 }); 242 243 if ($("body").hasClass("iphone")) { 244 $('.chooose_nav li a').on("click", function() { 245 var a_href = $(this).attr('href'); 246 if(a_href != undefined || a_href != null){ 247 window.location.href =a_href; 248 } 249 console.log('jq'); 250 }) 251 } 252 253}); 254 255})(jQuery); 256 257}); 258 259 260 261
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.