このバグはとても奇妙です...
私のサイトはhttps://www.merchantsbar.com/index.php です。ページの下部にある [お問い合わせ] をクリックするか、左側の [サインアップ] をクリックすると、jquery ui ダイアログの shd ポップアップが表示されます。iPad を除く、私がテストしたすべてのブラウザで動作します。アニメーションの後、ダイアログは非表示になります。iPadをお持ちの場合は、テストしてください。
私は問題を突き止め、Google マップが問題の原因であることに気付きました。関数が起動されると、ダイアログは失われます (これまでのところ、問題を引き起こしているのは 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'); }); }
});
});