2013-05-12 64 views
0

太奇怪了这个bug ......jQuery的用户界面对话框不GMAP工作在ipad

我的网站是https://www.merchantsbar.com/index.php 如果单击“联系人”页面的底部,或者“注册”在左边,一个jquery ui对话框shd弹出。 它适用于我测试过的所有浏览器,除了ipad。对话框在动画之后隐藏。如果你有ipad,请去测试一下。

我追捕问题&实现其谷歌地图造成问题的原因。一旦这个函数被触发,对话框就会丢失(请记住,迄今为止,ipad是唯一一个给我带来问题的,即使iphone也能工作!)。

在此先感谢!

function initialize(canvas, AC, field_Lat, field_Lng, readonly, search_area){ 
    var Lat = Number($("#"+field_Lat).val()) == NaN ? $("#"+field_Lat).val() : 40.7399709 ; 
    var Lng = Number($("#"+field_Lng).val()) == NaN ? $("#"+field_Lng).val() : -73.6135758 ; 

    var latlng = new google.maps.LatLng(Lat, Lng); // LatLng 
    var options = { 
     zoom: 11, 
     center: latlng, 
     mapTypeId: google.maps.MapTypeId.ROADMAP 
    }; 

    map = new google.maps.Map(document.getElementById(canvas), options); // MAP 
    geocoder = new google.maps.Geocoder(); //GEOCODER 

    if (readonly==true){ marker = new google.maps.Marker({ map: map }); } // readonly 
    else{ 
     if (search_area==true){ var distanceWidget = new DistanceWidget(map); } // SEARCH_AREA 
     else{ marker = new google.maps.Marker({ map: map, draggable: true }); } // non-search_area 
     autocomplete(AC, field_Lat, field_Lng); 
     geocodeReverse(AC, field_Lat, field_Lng); 
    } 
    marker.setPosition(latlng); 
} 

function autocomplete(AC, field_Lat, field_Lng){  
    $("#"+AC).autocomplete({ 
     //This bit uses the geocoder to fetch address values 
     source: function(request, response){ 
      geocoder.geocode({'address': request.term }, function(results, status){ 
       response($.map(results, function(item){ 
        return { 
         label: item.formatted_address, 
         value: item.formatted_address, 
         latitude: item.geometry.location.lat(), 
         longitude: item.geometry.location.lng() 
        } 
       })); 
      }) 
     }, 
     //This bit is executed upon selection of an address 
     select: function(event, ui){ 
      $("#"+field_Lat).val(ui.item.latitude); 
      $("#"+field_Lng).val(ui.item.longitude); 
      var location = new google.maps.LatLng(ui.item.latitude, ui.item.longitude); 
      marker.setPosition(location); 
      map.setCenter(location); 
     } 
    });   
} 

function geocodeReverse(AC, field_Lat, field_Lng){ 
    google.maps.event.addListener(marker, 'dragend', function(){ 
     geocoder.geocode({'latLng' : marker.getPosition()}, function(results, status){ 
      if (status == google.maps.GeocoderStatus.OK){ 
       if (results[0]){ 
        $('#'+field_Lat).val(marker.getPosition().lat()); 
        $('#'+field_Lng).val(marker.getPosition().lng()); 
        $('#'+AC).val(results[0].formatted_address); 
        $("#Se_latitude, #Se_longitude").focus(); // inter-linked to validateField(); 
        $("#"+field_Lat+", #"+field_Lng+", #"+AC).blur(); 
       } 
      } 
     }); 
    }); 
} 

...后...

$(".dialog").each(function(){ 
    var this_ID = this.id; 
    $(this).dialog({ 
     autoOpen: false, 
     modal: true, 
     width: "auto", 
     show: { 
      effect: "slide", 
      duration: 400 
     }, 
     hide: { 
      effect: "slide", 
      duration: 400 
     }, 
     open: function(){ $('.ui-widget-overlay').on('click', function(){ $("#"+this_ID).dialog('close'); }); } 
    }); 
}); 

回答

0

力3D加速用CSS3 ...

.ui-dialog * { 
    -webkit-transform: translate3d(0, 0, 0); 
} 
相关问题