onblur事件不适用于模态弹出

时间:2018-06-04 16:11:12

标签: javascript

$('#addnewship').on('shown.bs.modal', function(e) { 

     e.preventDefault();

         $('#addnewshipfrm').find("input[type=text], textarea, select").val(""); 
         initMap();

     }); 

  var map; 
  function initMap() {

    var map = new google.maps.Map(document.getElementById('map_canvas'), {

      zoom:15,
      mapTypeId: google.maps.MapTypeId.HYBRID,
      center: {lat: 36.3096, lng: -119.3273}
    });
    var geocoder = new google.maps.Geocoder();

    document.getElementById('zipcode').addEventListener('blur', function() {

      geocodeAddress(geocoder, map);
    });
  }

0 个答案:

没有答案