Viewing 5 replies - 1 through 5 (of 5 total)
  • I have no idea why this would he happening. I could not reproduce this on a site with default theme and only Easy FancyBox.

    It might be a conflict with another plugin or your theme that loads a script on search pages that is not loaded on other pages for example…

    Ok, I notice there is a plugin mls-data-feed that tries to load elements of a conflicting version of fancybox. Does that plugin come with an option to disable its lightbox?

    Thread Starter vivojack

    (@vivojack)

    Thanks RavanH!
    That puts me on the right track. I removed fancybox from mls-data-feed (I am the author) and that corrected the issue with the ajax spinner not displaying properly, but the youtube video still didn’t load. Only the fancybox css was loading as I had already disabled the javascript. It appears to be related to the fact that I am using a ajax post to pull listing results into the search page. When I disable that, Easy Fancybox works fine. But I am unclear to why using ajax locally would prevent Easy Fancybox from working with youtube.

    I was able to enqueue fancybox into the theme directly and get it to work (sort of). The video loaded but it seemed to keep reloading the video and fancybox every few seconds…

    Anyway if you have any further thoughts, I would appreciate them but I recognize that is above and beyond.

    Thanks again!

    Thread Starter vivojack

    (@vivojack)

    Just to close the loop. I was unable to get this working using Easy Fancybox, but I enqueued the latest version of fancybox into the theme directly and then used this:

    $(".fancybox").click(function() {
       		$.fancybox({
    			helpers : {
    	            title : null,
    	            media : {}
    	        },
    	        arrows : false,
    	        autoPlay : false,
    	        loop : false,
    	        iframe : {
    	            scrolling : 'auto',
    				preload   : true
    	        },
    	        height : 360,
    	        width : 640,
    	        autoSize : false,
    	        'href' : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
    		});
    	return false;
    	});

    to launch fancybox with the youtube video and it works whether there is an ajax call on the page or not. So it does seem to be some sort of conflict between Easy Fancybox and when a local AJAX call has been enabled on the page in WordPress. You might want to test that. I can provide more details if that would help.

    Thanks!

    RavanH, Easy Fancybox used to work great on my site for viewing a YouTube videos from a text link. I updated to the latest version and I use WP 4.1.1. Now not working. Images display OK. See: https://www.beachwed.com, click Start Here, Step 3, site names are links to YouTube posted videos. Thanks for the help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Easy Fancybox with youtube not working on search results page?’ is closed to new replies.