jQuery Fancybox-附加到fancybox-inner [英] jQuery Fancybox - Append to fancybox-inner

查看:118
本文介绍了jQuery Fancybox-附加到fancybox-inner的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用fancybox 2.0.5.我的尺寸为450 x500.它的内容是长期使用协议.用户必须单击底部的接受按钮.我们希望能够将其固定在fancybox弹出窗口的底部,因此无论滚动如何,它都是静态"的.我正在尝试使用下面的方法无济于事.我无法让.fancybox-inner响应任何内容.有建议吗?

I'm working with fancybox 2.0.5. I have it opening to a size of 450 x 500. The content of it is a long terms of use agreement. The user must click the accept button at the bottom. We'd like to be able to have it stuck to the bottom of the fancybox popup so that it is "static" regardless of the scrolling. I am trying to use the below to no avail. I can't make .fancybox-inner respond to anything. Suggestions?

$(".fancybox-inner").append("<input id='accept' type='button' value='Accept'>");

推荐答案

由于渲染fancybox的div在加载fancybox之前没有任何内容,因此需要在fancybox加载后触发代码:

Since the div thats rendering the fancybox doesn't have any content until you load fancybox, you need to trigger your code after the fancybox has loaded:

$(".fancybox").fancybox({
    onComplete: function(){
        $(".fancybox-inner").append(""); 
    }
});

或者,您可以告诉fancybox本身不要滚动 并在内容中设置一个overflow:auto容器div,然后在其后添加(agree)按钮

Alternatively, you could tell fancybox itself not to scroll and set an overflow:auto container div inside your content, and add the (agree) button after

这篇关于jQuery Fancybox-附加到fancybox-inner的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆