Support » Plugin: WP Video Lightbox » Video overlay on Ajax loaded content

  • Resolved niklaas_

    (@niklaas_)


    Hi!

    I’m using this plugin with links like this instead of shortcodes:
    <a rel="wp-video-lightbox" href="VIDEO-URL">PLAY VIDEO</a>

    It works great, but not on content loaded via AJAX. My guess is that the plugin uses some sort of click event that doesn’t work with dynamically added content. Where in the plugin files can I see and edit this?

    Thanks,

    Niklas

    • This topic was modified 4 months, 2 weeks ago by  niklaas_.
    • This topic was modified 4 months, 2 weeks ago by  niklaas_.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support mbrsolution

    (@mbrsolution)

    Hi, just for testing purposes can you test the following shotcode instead of HTML? Make sure you change the video_id?

    [video_lightbox_youtube video_id=”G7z74BvLWUg” width=”640″ height=”480″ anchor=”Click Me”]

    Thank you

    Hi,

    Same thing. Works on posts that was loaded directly, not on posts that was loaded with ajax.

    I have had the same issue with other clickable elements and fixed them all by using
    on() instead of click() in my javascript. But I cant figure out where in the plugin files I can edit this.

    Thanks,
    /Niklas

    Never mind I solved it 🙂

    Gave the links a class and edited jquery.prettyPhoto.min.js to be $(document).on('click', '.popup_video', $.prettyPhoto.initialize); instead of the return statement there.

    Plugin Support mbrsolution

    (@mbrsolution)

    Hi, that is great news. Well done. Remember that when ever you update the plugin you will loose your custom code. So make sure you keep a copy of the edited file in your laptop or computer.

    Can you mark this support thread as resolved.

    Thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.