Skip to content

Prototype.js conflict #177

Answered by fancyapps
dandovnar asked this question in Q&A
Nov 21, 2021 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

Hi,

The problem is that Prototype messes with the event object and Fancybox does not receive event.target, it is empty!

It is hard to debug, but you could try to observe that by yourself with this snippet:

document.body.addEventListener(
    "click",
    function (event) {
      console.log(event.target);
    },
    false
);

If I then click on the links, the output is empty for the fraction of second, but then it magically changes to actual value. I suspect that Prototype receives event by reference, removes target, does some stuff and then places back. But Fancybox click handler executes before it is placed back and therefore it can not figure out what to do and does not start.

I could n…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by dandovnar
Comment options

You must be logged in to vote
1 reply
@dandovnar
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants