[英]Adding margin to top and bottom of fancybox due to fixed navigation
I've added a margin to the top and bottom of my fancybox images, due to the fact I have a fixed nav bar at the top of my page, using the code I found in this question . 由于我使用在此问题中找到的代码,在页面顶部具有固定的导航栏,因此在fancybox图像的顶部和底部添加了页边距。 I have added this to my jQuery like it said:
我已经将它添加到我的jQuery中,就像它说的那样:
<script type="text/javascript">
$("a.fancybox").fancybox({
margin: [120, 60, 50, 60] // top, right, bottom, left
});</script>
Below this: 在此以下:
<script type="text/javascript">
$(document).ready(function() {
$("a.fancybox").fancybox({
'transitionIn' : 'fade',
'transitionOut' : 'fade',
'speedIn' : 600,
'speedOut' : 200,
'overlayShow' : true
});
});
</script>
The problem is that when clicking a single image it works the way I want (sits over top of the navigation), but navigating through the images, the next ones which are tall (portrait oriented) sit behind the nav again. 问题在于,单击单个图像时,它可以按照我想要的方式工作(位于导航上方),但在浏览图像时,接下来的又一个较高(面向人像)的图像又位于导航后面。 I've tried increasing the top margin value but nothing changes.
我尝试增加最高保证金值,但没有任何变化。
This is the page with fancybox on it: http://pacificdesignacademy.com/gallerygd.php 这是上面带有fancybox的页面: http : //pacificdesignacademy.com/gallerygd.php
Am I doing something wrong here? 我在这里做错什么了吗? Any suggestions are much appreciated.
任何建议,不胜感激。 Thanks!
谢谢!
Change this 改变这个
<script type="text/javascript">
$(document).ready(function() {
$("a.fancybox").fancybox({
'transitionIn' : 'fade',
'transitionOut' : 'fade',
'speedIn' : 600,
'speedOut' : 200,
'overlayShow' : true
});
});
</script>
<script type="text/javascript">
$("a.fancybox").fancybox({
margin: [120, 60, 50, 60] // top, right, bottom, left
});</script>
by this 这样
<script type="text/javascript">
$(document).ready(function () {
$("a.fancybox").fancybox({
'transitionIn': 'fade',
'transitionOut': 'fade',
'speedIn': 600,
'speedOut': 200,
'overlayShow': true,
margin: [120, 60, 50, 60] // top, right, bottom, left
});
});
</script>
NOTE : your API options are obsolete (v1.3.4) check the documentation for the right options of the version you are using 注意 :您的API选项已过时(v1.3.4),请查看文档以获取所使用版本的正确选项
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.