Fancybox doesn’t load on “next” page of table
-
I am using the TablePress plugin which is built on the “DataTables” framework to organize and display yoga classes available on my client’s website.
The example table attached here only has 10 rows, but if I set it to only display 5 per page, Fancybox stops working on page 2. Instead of popping up the video in a fancybox like in page 1, it tries to redirect the user to the video hosted on vimeo…which is not accessible.
I reached out to the table plugin developer thinking it was something on their end, but they pointed out this exact thing is a limitation of the “DataTable” JS framework:
https://datatables.net/faqs/#events
Q. My events don’t work on the second page
A. When attaching events to cells in a table controlled by DataTables, you need to be careful how it is done. Because DataTables removes nodes from the DOM, events applied with a static event listener might not be able to bind themselves to all nodes in the table. To overcome this, simply use jQuery delegated event listener options, as shown in this example. Additionally, you could use my Visual Event bookmarklet to help debug event issues.In the linked example, the programmer speaks as if “simply use jQuery delegated event listener” is a trivial task. It may be for a JS programmer; however, I am not.
And since this seems like such a trivial task, I’m wondering if there’s already a built-in setting or easy workaround that you’ve already developed in Easy Fancybox.
Any help you can offer would be great. The real table I’m working with for my client is already 55 rows and grows each week. In theory, it will be hundreds of rows long which is unrealistic to display all at once on a single page.
Thank you
The page I need help with: [log in to see the link]
- The topic ‘Fancybox doesn’t load on “next” page of table’ is closed to new replies.