简体   繁体   English

定位fancybox盒子?

[英]Positioning the fancybox box?

How do I modify the positioning of the fancybox box? 如何修改fancybox盒的位置? I want it to be positioned so that it floats right within my container div... 我希望它被定位,以便它漂浮在我的容器div中......

Thanks for all your time and help! 感谢您的所有时间和帮助!

line 255 of jquery.fancybox-1.2.6 has this bit of code jquery.fancybox-1.2.6的255行有这段代码

var itemOpts = {
  'left':       itemLeft,
  'top':        itemTop,
  'width':  width + 'px',
  'height': height + 'px'
};

change the 'left' value to move the fancy box left or right 更改“左”值以向左或向右移动花式框

You can affect the positioning of the wraper for fine tuning using those: 您可以使用以下方法影响包装器的定位以进行微调:

$("#fancybox-wrap").css("margin-left","-75px");
$("#fancybox-wrap").css("margin-top","60px");

but you will have to adjust it to your needs as well as calculating the viewport dimensions as well. 但您必须根据需要调整它以及计算视口尺寸。

尝试将这样的东西滑入你的jquery:

$("#fancy_outer").css({"float":"right","position":"static"});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM