javascript - 随页面滚动绝对位置div

标签 javascript jquery html css

我正在使用 fancybox 2,我希望 fancybox 模态随页面滚动,而不是固定在中心并具有最大高度。我该怎么做?

$('.fancybox-open').fancybox({
     openEffect  : 'none',
     closeEffect : 'none',
     width: '100px',
     'closeBtn' : true,
     afterLoad   : function() {
        this.content.html();
     }
});

最佳答案

您可以在初始化 FancyBox 时使用选项 autoCenter: false:http://fancyapps.com/fancybox/#docs

关于javascript - 随页面滚动绝对位置div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21419870/

相关文章:

javascript - 我真的需要使用 jQuery 检查元素是否存在吗?

javascript - 在 div 中输入输入文本,但不交换旧文本

javascript - 从 restify 获取正确的 json 输出

iframe 的 Javascript 事件完成加载

javascript - 使用 jquery 将 mousemove 移出框架 div 标记时出错?

html - div 中的图像在图像下方有额外的空间

javascript - jQuery 按数据属性选择元素意外结果

javascript - 如何创建 html 页面的实例并动态加载到主页列表中

html - 动态内容 : How to adjust div's position automatically?

html - 在显示 block div 上垂直对齐