See the this for q demo: Try it
I have one problem in my development. I used below Script to load the Fancybox Popup .
After clicking Submit
button, it would open another popup which contains a map. That map is working perfectly on Firefox, however it does not work on other browsers.
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. These lines executes synchroniously, what mean you have to define function first. I am a bit surprised how this could work in Firefox.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.