• Hello,
    I have a problem with fancyboxs. I have the code of fancybox in some pages and I would like to show the same contact form in all of this pages, but it doesn’t work. When I click in a link inside page A it shows me the poupup with the contact form, then I change the page to page B and I click in a link to show the same contact form and it doens’t appears, it reload the page. The id of a link in the differents pages are different. So I don’t know what is the problem?

    Thank you

    https://www.ads-software.com/plugins/easy-fancybox/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi Sandra,

    The IDs do not have to be different if they are on different pages. One ID can only be used once per page, not across the entire domain.

    The problem is probably this: not only the link/button but also the hidden form must be together on the same page. Otherwise FancyBox has no way of finding the content. It’s called ‘inline’ content after all ??

    And of course, the ID used for the inline content and the ID used in the link/button target must match.

    If you need this popup contact form on all pages, your best option is to place both the link/button and the hidden content in a text widget. That way, you’ll only have to create one button and contact form and it will be available on all pages, just like any other widget.

    Thread Starter sandradyl

    (@sandradyl)

    Hi Ravan,
    Thank you for your answer. The problem to insert it in a widget area is the situation, beacuse I want to display it in some parts of the page.

    The code I have inserted in one page is:

    Click
    <div class=”fancybox-hidden” style=”display: none;”>
    <div id=”contact_form_pop1″ class=”hentry”>[contact-form-7 id=”222″ title=”Contacto Popup”]</div>
    </div>

    And the code in the other page is:

    Click
    <div class=”fancybox-hidden” style=”display: none;”>
    <div id=”contact_form_pop10″ class=”hentry”>[contact-form-7 id=”222″ title=”Contacto Popup”]</div>
    </div>

    I don’t know what is the problem, maybe conflicts with js of something like this?

    Thread Starter sandradyl

    (@sandradyl)

    I write again the code because I forgot to click code button, sorry.

    First page:

    <a class="qbutton big_large_full_width center fancybox-inline boton_web" href="#contact_form_pop1">Click</a>
    <div class="fancybox-hidden" style="display: none;">
    <div id="contact_form_pop1" class="hentry">[contact-form-7 id="222" title="Contacto Popup"]</div>
    </div>

    Second page:

    <a class="qbutton big_large_full_width center fancybox-inline boton_web" href="#contact_form_pop10">Click</a>
    <div class="fancybox-hidden" style="display: none;">
    <div id="contact_form_pop10" class="hentry">[contact-form-7 id="222" title="Contacto Popup"]</div>
    </div>

    Hmmm… I see no errors in your code. There must be another reason why it’s not working on one of the pages. Do you get any errors in your browser’s developer tools console?

    Maybe links to your two pages will tell me more ??

    Thread Starter sandradyl

    (@sandradyl)

    When I click in the link with Firebug appear the following error:

    TypeError: $j(...)offset(...) is undefined   (default.min.js line 1, col 90112)
    ...d_not_transparent')){if(sticky_amount>=$j('[data-q_id="'+hash+'"]').offset().top...

    There are an arrow in ‘$j(‘

    Hmmm, it does not look like that error comes from FancyBox but it might very well be the cause of FancyBox not working. It needs to be fixed before following script (like FancyBox) will run. Do you know where default.min.js comes from? Is it part of your theme?

    Thread Starter sandradyl

    (@sandradyl)

    Yes, the file is part of the theme…

    Maybe the theme developers can tell you more then ?

    Thread Starter sandradyl

    (@sandradyl)

    The theme developers told me that they don’t offer support to this plugin.
    What can I do?

    … they don’t offer support to this plugin.

    Which plugin? Easy FancyBox? Of course they don’t. But the error is not coming from Easy FancyBox. It’s coming from a theme script.

    Does the error disappear when you disable Easy FancyBox? If so, let me know and please share a link to the page where the problem occurs.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Doesn't work in some pages’ is closed to new replies.