[英]Google Map using Fancybox working Firefox perfectly but Other Browsers it Doesn't Work
See the this for q demo: Try it 有关q演示,请参阅此内容: 试一试
I have one problem in my development. 我的开发中有一个问题。 I used below Script to load the Fancybox Popup .
我使用下面的脚本来加载Fancybox Popup 。
After clicking Submit
button, it would open another popup which contains a map. 单击“
Submit
按钮后,将打开另一个包含地图的弹出窗口。 That map is working perfectly on Firefox, however it does not work on other browsers. 该地图在Firefox上完美运行,但它不适用于其他浏览器。
I must be able to get that map working on all current browsers. 我必须能够使该地图适用于所有当前浏览器。 Please guide me to solve this problem
请指导我解决这个问题
<script type="text/javascript">
$(document).ready(function() {
$("#zipcodechange").click(function() {
$.fancybox({
href : "#zipcode",
helpers: { overlay: { css: { 'background': 'rgba(0, 0, 0, 0.65)' } } },
afterClose : function(){
$.fancybox.close();
}
}); // fancybox
}); // click
$("#zipcode").bind("submit", function() {
$.fancybox.showLoading();
$.ajax({
url : "map-5.php",
type: "POST",
data: $("#zipcode").serializeArray(),
success: function(responseText) {
$.fancybox.open({
content : '<iframe id="myFrame" class="fancybox-iframe"
frameborder="0" vspace="0" hspace="0" src="about:blank"></iframe>',
width : '70%',
height : '700px',
// fitToView: false,
autoSize: false, //
closeClick: false,
openEffect: 'elastic',
closeEffect: 'fade',
helpers: {overlay: {css: {'background': 'rgba(0, 0, 0, 0.65)' } } },
afterShow : function() {
var oIframe = document.getElementById('myFrame');
var iframeDoc = (
oIframe.contentWindow.document ||
oIframe.contentDocument ); iframeDoc.open();
iframeDoc.write(responseText);
iframeDoc.close();
},
afterClose: function () {
location.reload();
return;
}
}); // fancybox
} // success
}); // ajax
return false;
}); // bind
}); // ready
</script>
Sir, you define showAddress
in 81 line but call it in 17 line. 先生,您在81行中定义
showAddress
,但在17行中调用它。 These lines executes synchroniously, what mean you have to define function first. 这些行同步执行,你必须首先定义函数。 I am a bit surprised how this could work in Firefox.
我有点惊讶这在Firefox中是如何工作的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.