Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9140387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:30:36+00:00 2026-06-17T09:30:36+00:00

I’ve got a fancybox which loads inline content. The content is rendered on the

  • 0

I’ve got a fancybox which loads inline content. The content is rendered on the page as the website is loaded and on document ready the fancybox is shown. The HTML and javascript to do this is as following;

HTML:

<div style="display: none">
    <div id="cookieContainer">
        <div class="splash">
            <!-- Some more content here -->
            <div class="buttons">
                <a href="javascript:parent.jQuery.fancybox.open({href : '<%=UrlRewriter.GetUrlForSystemName("MyPage")%>'})" class="cookie_button settings">Instellingen</a>
                <a href="javascript:void(0);" class="cookie_button accept">Accepteren</a>
            </div>
        </div>
    </div>
</div>

JAVASCRIPT:

$(document).ready(function(){
          $("a#myUrl").fancybox({
                'closeClick': false,
                'modal': false,
                'closeBtn': false,
                'width': '400px',
                'height': '200px',
                'autoSize': false,
                'padding': 10,
                'margin': 0
            });

          $('a#myUrl').trigger('click');
});

The fancybox contains two hyperlinks. One which executes some javascript (the button with the class ‘cookie_button accept’) and another one which should send the user to an specific url inside the currently active fancybox.

I’ve already tried various options from the Fancybox website, but none of them are giving me the desired result. One of the examples (the one with the iFrame) has the functionality I want, however this one navigates from an fancybox with the type ‘iFrame’ to another one with the same type. What i’m trying to do here is to navigate from an fancybox of the type ‘inline’ to an fancybox of the type ‘iFrame’. Is this even possible? Or are there other ways to achieve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:30:36+00:00Added an answer on June 17, 2026 at 9:30 am

    This is how you can do in your inline content (notice I use the rendered html)

    <a id="myUrl" href="#cookieContainer">open fancybox</a>
    
    <div style="display: none">
      <div id="cookieContainer">
        <div class="splash">
          <!-- Some more content here -->
          <div class="buttons"> 
            <a href="http://jsfiddle.net" id="myUrl2" class="cookie_button settings" data-fancybox-type="iframe">Instellingen</a>
            <a href="javascript:void(0);" class="cookie_button accept" onclick="jQuery.fancybox.close()">Accepteren</a>
          </div>
        </div>
      </div>
    </div>
    

    The link on top is the selector bound to fancybox (#myUrl).

    Now, regarding the buttons inside the inline content, the first one (Instellingen) doesn’t need to run javascript to open the new fancybox; you can rather set it as a regular link, in your case, like :

    <a href="<%=UrlRewriter.GetUrlForSystemName("MyPage")%>" id="myUrl2" class="cookie_button settings" data-fancybox-type="iframe">Instellingen</a>
    

    NOTICE that I added two attributes to that link:

    • id="myUrl2" : the new selector to be bound to fancybox
    • data-fancybox-type="iframe" : so next fancybox will open as iframe

    Then the fancybox script :

    $(document).ready(function () {
      $("#myUrl, #myUrl2").fancybox({
        closeClick: false,
        closeBtn: false,
        width: 400,
        height: 200,
        autoSize: false,
        fitToView : false,
        padding: 10,
        margin: 0
      });
      $('a#myUrl').trigger('click');
    });
    

    Notice that we are binding fancybox to both selectors outside and inside of fancybox :

    $("#myUrl, #myUrl2")
    

    Also notice that I changed 'width': '400px' and 'height': '200px' by width: 400 and height: 200 (integer and Boolean values go without quotes and ‘px’ in implied).

    I also removed 'modal': false because is the default value and added fitToView : false since you are using autoSize: false.

    Optionally I added onclick="jQuery.fancybox.close()" to the “Accepteren” button so it will close the inline fancybox after click but you may not need that.

    That will make you move from your fancybox inline content to a fancybox iframe content.

    See demo JSFIDDLE

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
i got an object with contents of html markup in it, for example: string
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am using JSon response to parse title,date content and thumbnail images and place
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace
I have this code to decode numeric html entities to the UTF8 equivalent character.
I would like to run a str_replace or preg_replace which looks for certain words

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.