$.simpleWeather({ location: 'Florence, Italy', woeid: '', unit: 'c', success: function(weather) { var 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(); }); });