Answer the question
In order to leave comments, you need to log in
FancyBox 3 how to access content?
In an event
beforeShow: function(instance, current) {
console.info('done!');
console.info(current);
}
{
$content:[div.htmlDataBlock.fancybox, prevObject: k.fn.init(1)]
$slide: [div.fancybox.fancybox, prevObject: k.fn.init(1)]
$thumb: null
contentType: "html"
forcedDuration: undefined
index: 0
isComplete: true
isLoaded: true
isLoading: false
}
beforeShow: function(instance, current) {
console.info(current.$content);
}
Answer the question
In order to leave comments, you need to log in
For some reason, at the time of the console.log call, the $content property does not yet have an array of references to dom elements, they are filled later (but console.log shows the state not at the time of the call, but the actual one).
If you place the working code in the sandbox, you can understand what the problem is.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question