问题
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