jQuery Fancybox - Append to fancybox-inner

断了今生、忘了曾经 提交于 2019-12-12 00:41:14

问题


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'>");

回答1:


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(""); 
    }
});

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



来源:https://stackoverflow.com/questions/9639016/jquery-fancybox-append-to-fancybox-inner

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!