'use strict'; $(function() { var loadData = function(data, endMethod) { data['j677a973eb9645153370036dfaab12dbe9fdfc52af3d838'] = '677a973eb965c345346083f69ba4971f784ea7de246cf5'; $.ajax({ type: 'POST', dataType: "json", url: 'webcam-service.html', data: JSON.stringify(data), contentType: "application/json", success: function(res) { if (res.result) { endMethod(res.data); } else { bootbox.alert(res.message); } }, error: function() { bootbox.alert('Errore imprevisto!'); } }); }; var clearSelect = function(select) { $(select).html(''); }; var appendOpt = function(select, value, text) { $(select).append($('', { value: value, text: text })); }; var loadAree = function() { loadData({ 'cmd': 'aree', 'id_regione': $('#w-regione').val() }, function(data) { var oldVal = $('#w-area').val(); clearSelect('#w-area'); appendOpt('#w-area', 0, 'Tutte le aree'); data.forEach(function(v) { appendOpt('#w-area', v.id, v.title); if (v.id == oldVal) { $('#w-area').val(v.id); } }); asyncFilterList(); }); }; var prepareList = function() { var jListLazy = $('#result-list div.lazy'); jListLazy.each(function() { $(this).on('load-cam', function() { var jRow = $(this); jRow.off('load-cam'); var jContainer = jRow.find('a.webcam-container'); var localUrl = jContainer.attr('href'); PmaxThumbnail.place({ id: jContainer.attr('id'), culture: "it-IT", target: "_blank", height: 250, instanceName: true, instanceLogo: false, map: false, weather: true, timelapse: false, instance: jContainer.attr('data-instance') }); jContainer.on('mouseenter click', function() { jContainer.removeAttr('target'); jContainer.attr('href', localUrl); }); }); lazyLoad(); }); }; var filterList = function() { var jList = $('#result-list'); var jEmpty = $('#result-empty'); var wRegione = $('#w-regione').val(); var wArea = $('#w-area').val(); var wTipo = $('#w-tipo').val(); var wCerca = $('#w-cerca').val(); var count = 0; var countVisible = 0; jEmpty.hide(); jList.children().each(function() { count++; var show = true; var jEl = $(this); if (wRegione != '0') { if (jEl.attr('data-regione') != wRegione) { show = false; } } if (wArea != '0') { if (jEl.attr('data-area') != wArea) { show = false; } } if (wTipo != '0') { if (jEl.attr('data-tipo') != wTipo) { show = false; } } if (show && wCerca != '') { var text = jEl.text().toLowerCase(); show = text.indexOf(wCerca.toLowerCase()) >= 0; } if (show) { jEl.removeClass('hidden'); jEl.addClass('show'); jEl.show(); countVisible++; } else { jEl.removeClass('show'); jEl.addClass('hidden'); jEl.hide(); } }); if (countVisible == 0) { jEmpty.show(); } }; var tmrFilterList = null; var asyncFilterList = function() { clearTimeout(tmrFilterList); $('#result-list').css('opacity', '0.5'); tmrFilterList = setTimeout(function() { tmrFilterList = null; filterList(); $('#result-list').css('opacity', ''); lazyLoad(); }, 200); }; var tmrLazyLoad = null; var lazyLoad = function() { clearTimeout(tmrLazyLoad); tmrLazyLoad = setTimeout(function() { tmrLazyLoad = null; var jListLazy = $('#result-list div.lazy.show'); var wt = $(window).scrollTop(); var wb = wt + $(window).height() * 3; jListLazy.each(function() { var ot = $(this).offset().top; var ob = ot + $(this).height(); if (wt <= ob && wb >= ot) { $(this).removeClass('lazy'); $(this).trigger("load-cam"); } }); }, 30); }; prepareList(); $('#w-regione').on('change', function() { loadAree(); }); $('#w-regione, #w-area, #w-tipo').on('change', function() { $('#w-cerca').val(""); asyncFilterList(); }); $('#w-cerca-btn').click(function () { asyncFilterList(); }); $('#w-cerca').keypress(function(event) { var keycode = (event.keyCode ? event.keyCode : event.which); if (keycode == '13') { $('#w-cerca-btn').focus(); asyncFilterList(); } }); $(window).scroll(lazyLoad); $(window).resize(lazyLoad); });
Montagna Alto Adige 360°
Stupenda Webcam a Stelvio - Stilfs ,paese dalla grande importanza strategica
Montagna Veneto 360°
La più grande parete delle Dolomiti (Civetta) protegge una splendida conca per lo sci.
Montagna Veneto 360°
La più alta (Marmolada), la più ampia (Civetta), il castello di roccia (Pelmo) e il lago di Alleghe dalle piste da sci.
Montagna Veneto 360°
Piste da sci di Alleghe con veduta sulle Dolomiti Bellunesi patrimonio UNESCO e sul Lago di Alleghe.