jQuery(document).ready(function ($) { "use strict"; // Maplace Destination Markers var LocsUS = [ { lat: 42.505365, lon: 11.20717, title: "Agence de voyage Viaggi Vacanze", html: "Agence de voyage Viaggi Vacanze", id: "135" }, { lat: 42.366202, lon: 10.881831, title: "Agence immobilière Ammiraglio", html: "Agence immobilière Ammiraglio", id: "246" }, { lat: 42.496671, lon: 11.192304, title: "Agence immobilière Agenzia Immobiare. La Rotonda", html: "Agence immobilière Agenzia Immobiare. La Rotonda", id: "130" }, { lat: 42.366202, lon: 10.881831, title: "Appartements privés Ammiraglio - Locazione estive", html: "Appartements privés Ammiraglio - Locazione estive", id: "128" }, { lat: 42.409869, lon: 11.208694, title: "Camping Village Camping Feniglia", html: "Camping Village Camping Feniglia", id: "252" }, { lat: 42.532773, lon: 11.185801, title: "Camping Village Il Gabbiano Camping Village", html: "Camping Village Il Gabbiano Camping Village", id: "158" }, { lat: 42.527452, lon: 11.188062, title: "Camping Village Village Camping Voltoncino", html: "Camping Village Village Camping Voltoncino", id: "230" }, { lat: 42.500463, lon: 11.194360, title: "Camping Village Bocche d\'Albegna Camping Village", html: "Camping Village Bocche d'Albegna Camping Village", id: "251" }, { lat: 42.519421, lon: 11.192333, title: "Camping Village Campin Village OASI", html: "Camping Village Campin Village OASI", id: "155" }, { lat: 42.535803, lon: 11.183787, title: "Camping Village Camping Hawaii", html: "Camping Village Camping Hawaii", id: "241" }, { lat: 42.524010, lon: 11.189617, title: "Camping Village Camping Village Marina Chiara", html: "Camping Village Camping Village Marina Chiara", id: "159" }, { lat: 42.429175, lon: 11.417809, title: "Ferme Monteverro", html: "Ferme Monteverro", id: "240" }, { lat: 42.580017, lon: 11.188153, title: "Ferme Azienda Agricola Ricci", html: "Ferme Azienda Agricola Ricci", id: "239" }, { lat: 42.544913, lon: 11.268330, title: "Ferme Botanical Dry Garden", html: "Ferme Botanical Dry Garden", id: "250" }, { lat: 42.404945, lon: 11.09266, title: "Hotel Torre di Cala Piccola", html: "Hotel Torre di Cala Piccola", id: "175" }, { lat: 42.434055, lon: 11.138178, title: "Hotel Baia D\'Argento", html: "Hotel Baia D'Argento", id: "166" }, { lat: 42.55303133172033, lon: 11.134395301214681, title: "Hotel Il Telamonio", html: "Hotel Il Telamonio", id: "173" }, { lat: 42.553763, lon: 11.131704, title: "Hotel Hotel Capo d\'Uomo", html: "Hotel Hotel Capo d'Uomo", id: "242" }, { lat: 42.441812, lon: 11.217683, title: "Hotel Park Hotel", html: "Hotel Park Hotel", id: "178" }, { lat: 42.521626, lon: 11.191189, title: "Residence Casale Voltoncino, Residenza d\'epoca", html: "Residence Casale Voltoncino, Residenza d'epoca", id: "190" }, { lat: 42.522117, lon: 11.189929, title: "Residence La Pineta", html: "Residence La Pineta", id: "189" }, { lat: 42.421060, lon: 11.182403, title: "Sport Argentario Polo Club SRL", html: "Sport Argentario Polo Club SRL", id: "214" }, { lat: 42.481584, lon: 11.192370, title: "Sport CM Equitazione", html: "Sport CM Equitazione", id: "215" }, { lat: 42.386611, lon: 11.20822, title: "Stabilimento balneare Riva del Marchese", html: "Stabilimento balneare Riva del Marchese", id: "227" }, { lat: 42.508268, lon: 11.196269, title: "Stabilimento balneare AI Delfini - Stabilimento balneare e Sosta Camper", html: "Stabilimento balneare AI Delfini - Stabilimento balneare e Sosta Camper", id: "217" }, { lat: 42.493175, lon: 11.248699, title: "Vacances à la ferme Antica Fattoria La Parrina", html: "Vacances à la ferme Antica Fattoria La Parrina", id: "136" }, { lat: 42.499931, lon: 11.251094, title: "Vacances à la ferme Podere del Priorato", html: "Vacances à la ferme Podere del Priorato", id: "248" }, { lat: 42.588497, lon: 11.108003, title: "Vacances à la ferme Club Le Cannelle", html: "Vacances à la ferme Club Le Cannelle", id: "137" }, { lat: 42.496455, lon: 11.194386, title: "Village Argentario Camping Village", html: "Village Argentario Camping Village", id: "221" }, { lat: 42.553687, lon: 11.174718, title: "Village Argentario Osa Village", html: "Village Argentario Osa Village", id: "220" }, { lat: 42.513884, lon: 11.194407, title: "Village Villaggio Golfo degli Etruschi", html: "Village Villaggio Golfo degli Etruschi", id: "154" }, { lat: 42.565103, lon: 11.139510, title: "Village Talamone Camping Village", html: "Village Talamone Camping Village", id: "222" }, { lat: 42.471646, lon: 11.257605, title: '', html: '' } ]; if ('undefined' !== typeof Maplace && $('.td-gmap').length ) { $('a[href="#destinations-map"]').on('shown.bs.tab', function () { var map = new Maplace({ map_div: '.td-gmap', controls_title: 'Choose a location:', locations: LocsUS, map_options: { mapTypeId: google.maps.MapTypeId.ROADMAP, set_center: [42.471646, 11.257605], zoom: 10 } }).Load(); google.maps.event.trigger(map, 'resize'); }); } if ('undefined' !== typeof Maplace && $('#gmap-route').length ) { // Maplace Route Map new Maplace({ locations: LocsRoute, map_div: '#gmap-route', generate_controls: false, show_markers: false, type: 'directions', draggable: false }).Load(); } // Search Filter $('#searchFilter').on('keyup', function(event) { var target = $(this), targetValue = $.trim(target.val().toLowerCase()), targetFilter = $('#td-search-filter-list li'), hasitems = false; $('#td-search-filter-list').hide(); targetFilter.each( function() { var item = $(this), link = item.children('a'), linkText = $.trim(link.text().toLowerCase()); if (!targetValue.length || linkText.substring(0, targetValue.length) !== targetValue ) { return item.hide(); } item.show(); hasitems = true; }); if(hasitems) { $('#td-search-filter-list').show(); } }); // Bootstrap Dropdown Fix $('.dropdown-menu').on ('click', function(e) { var target = $( e.target ); if ( target.is('a') ) { if ( target.filter(":not([data-toggle])").length ) { return; } var tabID = target.attr('href'), parent = target.parent(); parent.siblings().find('a.active').removeClass('active'); target.addClass('active'); $( tabID ).addClass('active'); $( tabID ).siblings().removeClass('active'); } e.stopPropagation(); e.preventDefault(); }); // UI Dropdowns $('#selectAdults').selectmenu(); $('#selectChildren').selectmenu(); $('#selectInfants').selectmenu(); // Date Range Picker var dateFormat = "dd/mm/yy", from = $( "#from" ).datepicker({ dateFormat: 'dd-mm-yy', defaultDate: "+1w", changeMonth: true }).on( "change", function() { to.datepicker( "option", "minDate", getDate( this ) ); }), to = $( "#to" ).datepicker({ dateFormat: 'dd-mm-yy', defaultDate: "+1w", changeMonth: true }).on( "change", function() { from.datepicker( "option", "maxDate", getDate( this ) ); }); function getDate( element ) { var date; try { date = $.datepicker.parseDate( dateFormat, element.value ); } catch( error ) { date = null; } return date; } // Footer Map Parallax Scrolling var getmapheight = $(".footer-map").height(); $(".wrapper").css({ "margin-bottom": getmapheight}); // Filterizr if ( "function" === typeof $.fn.filterizr && $('.filtr-container').length ) { $('.filtr-container').filterizr(); } $('.td-nav-filter .nav-item').on('click', '.nav-link', function(){ var self = $(this), parent = self.parent(); parent.siblings().find('.nav-link.active').removeClass('active'); self.addClass('active'); }); }); //Document Ready var mn = $(".navbar-nav"); mns = "main-nav-scrolled"; hdr = $('.td-navbar').height(); $(window).scroll(function() { if( $(this).scrollTop() > hdr ) { mn.addClass(mns); } else { mn.removeClass(mns); } // MENU LATERALE if( $(this).scrollTop() > $('.td-header').height() ) { $(".menustick").addClass("menusticksi"); } else { $(".menustick").removeClass("menusticksi"); } // MENU LATERALE });