$.simpleWeather({ location: 'Florence, Italy', woeid: '', unit: 'c', success: function(weather) { var html = '

' + weather.temp + '°' + weather.units.temp + '

'; html += ''; if (weather.forecast && weather.forecast.length) { // Check if forecast exists and has items for (var i = 0; i < weather.forecast.length; i++) { html += '' + weather.forecast[i].day + ': ' + weather.forecast[i].high + ''; } } $("#weather").html(html); }, error: function(error) { $("#weather").html('

' + error + '

'); } }); $('#modal-contacts-open').on('click', function(e) { var mod = $('#main'), modal = $('#modal-contacts'); mod.animate({ opacity: 0 }, 400, function() { $('html,body').scrollTop(0); modal.addClass('modal-active').fadeIn(400); // Set up markers var myMarkers = { "markers": [ { "latitude": "", "longitude": "", "icon": "" } ] }; // Set up map options $("#map").mapmarker({ zoom: 14, center: "", markers: myMarkers }); }); e.preventDefault(); $('.modal-close').on('click', function(e) { modal.removeClass('modal-active').fadeOut(400, function() { mod.animate({ opacity: 1 }, 400); }); e.preventDefault(); }); });