Support » Plugin: Easy FancyBox » Inline content won't open from main menu

  • Resolved radojica


    I added hidden div on the page:

    <div style=”display:none” class=”fancybox-hidden”>
    <div id=”contact_form_pop”>
    [contact-form 1 “Contact form 1”]

    And it works if I place link above:

    Contact Us

    But it won’t work with link from main menu (“Get started”)

    Example is here:

    Div is placed bellow testimonials.

    I added class “fancybox” and I also changed href to #contact_form_pop, but it looks like I’m missing something !?

    Can someone help please ?


Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author RavanH


    Hi, you are adding the class attribute by javascript with

    	jQuery('#menu-item-5041 a').addClass('fancybox').attr('href' , '#contact_form_pop');
    	jQuery('.ls-s2').addClass('fancybox').attr('href' , '#contact_form_pop');

    which would be fine but in this case, because you are using the document.ready wrapper, and this code appears in the footer, after the fancybox code, this class gets added after the fancybox script was fired. This is why fancybox does not spot it…

    jQuery(‘#menu-item-5041 a’).addClass(‘fancybox’).attr(‘href’ , ‘#contact_form_pop’);

    Thanks for help, it is working perfectly now 🙂

    I’m having a similar problem. I’m adding the css class “fancybox” in link from the main menu, however nothing is happening when that link is clicked. I’ve tried disabling all my plugins (except for fancy box, of course) and activating the default theme but nothing is working.

    Any suggestions?

    Can you share your link here ?

    Sure it’s the “About” menu item is what I am adding the class to

    This class can not be added from admin panel.

    This is your code:

    <li id="menu-item-589" class="<strong>fancybox-iframe</strong> menu-item menu-item-type-post_type menu-item-object-page menu-item-589">
    <a href="">About</a>

    Class should be added to link and in your case it is added to list item element.

    You should try to add jQuery code in footer.php like I did (I changed it for your menu).

    Go to Appearance->Editor and find footer.php file on the right side and then add next code.

    jQuery(‘#menu-item-589 a’).addClass(‘fancybox-iframe’);

    I hope this will help

    Thanks so much for your time and help.

    Does it matter where I add this in my Footer.php?

    I was adding the css class in the “css classes (optional)” located in the menus area. I thought I read that on the plugins site….Did I read something wrong or is this just the case for this one time?

    Just add it before </body> tag

    I just looked FAQ, and it says there that it can be added in dynamic menu…

    Didi you also complete this step also:

    Go to Settings > Media and enable FancyBox iFrame support.

    Plugin Author RavanH


    @christinarule yes you should be able to add the desired class — fancybox-iframe in your case? — to the custom menu css classes field. There is no need for extra script code in the footer.


    Thanks for taking the time to help me out. Take a loon at my screenshot here:

    I’ve taken out the extra footer script I had added but nothing is working. In fact when I add that class I can’t even click on the about page… nothing happens.

    I also double checked and made sure I did:

    Go to Settings > Media and enable FancyBox iFrame support.

    ANy other suggestions?

    Plugin Author RavanH


    @christinarule sorry I did not reply sooner.

    It looks like you’re facing another issue. The request for the dynamic stylesheet on meets a 404 page. Without that stylesheet, FancyBox will not show… Is there any security plugin running on your site that blocks direct requests to plugin files? Or any rule in the .htaccess (supposing your site runs on an Apache server) that would amount to the same blockage?

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Inline content won't open from main menu’ is closed to new replies.