WordPress.org

Ready to get started?Download WordPress

Forums

Easy FancyBox
[resolved] Inline content won't open from main menu (13 posts)

  1. radojica
    Member
    Posted 1 year ago #

    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"]
    </div>
    </div>

    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:
    http://mrmiller.tk/#contact_form_pop

    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 ?

    Thanks!

    http://wordpress.org/extend/plugins/easy-fancybox/

  2. RavanH
    Member
    Plugin Author

    Posted 1 year ago #

    Hi, you are adding the class attribute by javascript with

    <script>
    jQuery(document).ready(function(){
    	jQuery('#menu-item-5041 a').addClass('fancybox').attr('href' , '#contact_form_pop');
    	jQuery('.ls-s2').addClass('fancybox').attr('href' , '#contact_form_pop');
    });
    </script>

    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...

    Try:
    <script>
    jQuery('#menu-item-5041 a').addClass('fancybox').attr('href' , '#contact_form_pop');
    </script>

  3. radojica
    Member
    Posted 1 year ago #

    Thanks for help, it is working perfectly now :)

  4. christinarule
    Member
    Posted 1 year ago #

    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?

  5. radojica
    Member
    Posted 1 year ago #

    Can you share your link here ?

  6. christinarule
    Member
    Posted 1 year ago #

    Hi,
    Sure it's http://test.thebuzzbox.biz the "About" menu item is what I am adding the class to

  7. radojica
    Member
    Posted 1 year ago #

    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="http://test.thebuzzbox.biz/about/">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.

    <script>
    jQuery('#menu-item-589 a').addClass('fancybox-iframe');
    </script>

    I hope this will help

  8. christinarule
    Member
    Posted 1 year ago #

    Hey,
    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?

  9. radojica
    Member
    Posted 1 year ago #

    Just add it before </body> tag

  10. radojica
    Member
    Posted 1 year ago #

    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.

  11. RavanH
    Member
    Plugin Author

    Posted 1 year ago #

    @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.

  12. christinarule
    Member
    Posted 1 year ago #

    @RavanH

    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?

  13. RavanH
    Member
    Plugin Author

    Posted 1 year ago #

    @christinarule sorry I did not reply sooner.

    It looks like you're facing another issue. The request for the dynamic stylesheet on http://test.thebuzzbox.biz/wp-content/plugins/easy-fancybox/easy-fancybox.css.php?ver=1.3.4 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?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic