我正在使用fancybox打开外部网址。我厌倦了 fancybox-html 类 href 的代码:
$(document).ready(function() {
$(".fancybox-html").fancybox({
fitToView : false,
width : '90%',
height : '90%',
autoSize : false,
closeClick : false,
openEffect : 'none',
closeEffect : 'none'
});
});
.HTML:
<script type="text/javascript" src="http://localhost:8000/media/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="http://localhost:8000/media/js/jquery.pageslide.min.js"></script>
<script type="text/javascript" src="http://localhost:8000/media/js/autocomplete.js"></script>
<!-- <script type="text/javascript" src="http://localhost:8000/media/js/overlay.js"></script> -->
<!-- FancyBox -->
<link href="http://localhost:8000/media/fancybox/jquery.fancybox.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://localhost:8000/media/fancybox/jquery.fancybox.pack.js"></script>
<script type="text/javascript" src="http://localhost:8000/media/fancybox/jquery.easing-1.3.pack.js"></script>
<script type="text/javascript" src="http://localhost:8000/media/fancybox/jquery.mousewheel-3.0.6.pack.js"></script>
这不起作用,iframe 以不同的维度打开,就像它忽略我的设置一样。是否可以调试它?
也许我错过了一些库。
有什么想法吗?
首先,您必须下载最后一个花哨的盒子才能确定。然后将 js 和 css 包含在您的页面中,如果是 iframe,请尝试使用此代码。如果不起作用,请发布您的html,看看您是否有错误
$(".fancybox-html").fancybox({
width : '75%',
height : '75%',
autoSize : false,
closeClick : false,
fitToView : false,
openEffect : 'none',
closeEffect : 'none',
type : 'iframe'
});
<a href="yourpage.php" class="fancybox-html">test test</a>
试试这个:
$(document).ready(function() {
$(".fancybox-html").fancybox({
fitToView : false,
frameWidth : '90%',
frameHeight : '90%',
autoSize : false,
closeClick : false,
openEffect : 'none',
closeEffect : 'none'
});
});