我正在一个网站上工作,点击搜索图标后,它必须打开图像Pop up should be look like中显示的一个搜索窗口。但是在控制台中显示错误 index.php:113未捕获TypeError:$(...)。magnificPopup不是函数(...)
这是我的代码
<li>
<div class="search-bar">
<div class="search">
<a class="play-icon popup-with-zoom-anim" href="#small-dialog"><i class="glyphicon glyphicon-search"> </i> </a>
</div>
<script src="js/jquery.magnific-popup.js" type="text/javascript"></script>
<div id="small-dialog" class="mfp-hide">
<div class="search-top">
<div class="login_pop">
<form action="#" method="post">
<input type="submit" value="">
<input type="text" name="Type something..." value="Type something..." onfocus="this.value = '';" onblur="if (this.value == '') {this.value = '';}">
</form>
</div>
</div>
<script>
$(document).ready(function() {
$('.popup-with-zoom-anim').magnificPopup({
type: 'inline',
fixedContentPos: false,
fixedBgPos: true,
overflowY: 'auto',
closeBtnInside: true,
preloader: false,
midClick: true,
removalDelay: 300,
mainClass: 'my-mfp-zoom-in'
});
});
</script>
</div>
帮助我解决问题。
由于
答案 0 :(得分:0)
包含文件
<!-- jQuery 1.7.2+ or Zepto.js 1.0+ -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<!-- Magnific Popup core JS file -->
<script src="magnific-popup/jquery.magnific-popup.js"></script>