<!DOCTYPE html>
<html>
<head><script type="text/javascript" >
</script>
<!-- jQuery 1.7.2+ or Zepto.js 1.0+ -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.js">
$(document).ready(function () {
$('#btnContact').magnificPopup({
items: {
src: '../Documents/ContactForm.html'
},
type: 'iframe'
});
});
</script>
<section class="singlecol nosiblings" role="main">
<style>
<!-- Magnific Popup core CSS file -->
<link rel="stylesheet" href="magnific-popup/magnific-popup.css">
.responsive {
width: 100%;
height: auto;
}
</style>
</head>
如何解决?当我单击按钮不起作用。表单不会弹出,但是没有任何错误。为什么 $(document).ready(function())无法读取?
答案 0 :(得分:1)
您应该在不同的$(document).ready
标签中编写<script>
处理程序。
<script src="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.js">
</script>
<script>
$(document).ready(function () {
$('#btnContact').magnificPopup({
items: {
src: '../Documents/ContactForm.html'
},
type: 'iframe'
});
});
</script>