Attach fancybox to a link inside the fancybox

旧街凉风 提交于 2019-12-11 01:13:41

问题


I would like to know a way to load my fancybox and to attach a fancybox to one of the link in this fancybox. I'm using since today the last version of fancybox (2.0.1).

Here is what I tried without success:

    $('a.new_category_link').fancybox({
        closeClick: false,
        afterShow:  function() {
            $('a.edit_category_link').fancybox({
                closeClick: false
            });
        }
    });

As required with version 2.0.1, my link with class "edit_category_link" has also the class "fancybox.ajax".

For the people used to the oldest version, hideOnContentClick was replaced by closeClick and onComplete by afterShow.

Right now, when i click on a.edit_category_link loaded in my fancybox, it renders the page in html in the parent page, not the fancybox.

If you have an idea, please don't hesitate to share it!


回答1:


fancyBox since v2 is using "live" to handle clicks, so you my try like this -

$('a.new_category_link, a.edit_category_link').fancybox({
    closeClick: false
});


来源:https://stackoverflow.com/questions/8269610/attach-fancybox-to-a-link-inside-the-fancybox

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