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 8168923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:41:04+00:00 2026-06-06T20:41:04+00:00

Hopefully someone here can help me! I’m trying to set up fancybox so when

  • 0

Hopefully someone here can help me!

I’m trying to set up fancybox so when the webpage loads it displays some inline content. However I can’t seem to get it to work. Here’s the code I’ve used so far:

<script type="text/javascript">
    $(document).ready(function() {
        /*
         *  Simple image gallery. Uses default settings
         */

        $('.fancybox').fancybox();

        /*
         *  Different effects
         */

        // Change title type, overlay opening speed and opacity
        $(".fancybox-effects-a").fancybox({
            helpers: {
                title : {
                    type : 'outside'
                },
                overlay : {
                    speedIn : 500,
                    opacity : 0.95
                }
            }
        });

        $.fancybox.open([
            {
                href : '#inline1',
                title : '1st title'
            }   
        ], {
            padding : 0   
        });​

    });
</script>
<style type="text/css">
    .fancybox-custom .fancybox-skin {
        box-shadow: 0 0 50px #222;
    }
</style>

And the html is as follows:

    <h1>fancyBox</h1>

<ul>
    <li><a class="fancybox" href="#inline1" title="Lorem ipsum dolor sit amet">Inline</a></li>

</ul>

<div id="inline1" style="width:400px;display: none;">
    <h3>Etiam quis mi eu elit</h3>
    <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis mi eu elit tempor facilisis id et neque. Nulla sit amet sem sapien. Vestibulum imperdiet porta ante ac ornare. Nulla et lorem eu nibh adipiscing ultricies nec at lacus. Cras laoreet ultricies sem, at blandit mi eleifend aliquam. Nunc enim ipsum, vehicula non pretium varius, cursus ac tortor. Vivamus fringilla congue laoreet. Quisque ultrices sodales orci, quis rhoncus justo auctor in. Phasellus dui eros, bibendum eu feugiat ornare, faucibus eu mi. Nunc aliquet tempus sem, id aliquam diam varius ac. Maecenas nisl nunc, molestie vitae eleifend vel, iaculis sed magna. Aenean tempus lacus vitae orci posuere porttitor eget non felis. Donec lectus elit, aliquam nec eleifend sit amet, vestibulum sed nunc.
    </p>
</div>

Hope someone can help, as I’m only just learning jquery/javascript just now and I know this is all very hacked together.

Thanks in advance!

  • 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-06T20:41:06+00:00Added an answer on June 6, 2026 at 8:41 pm

    If you already have this

    <a class="fancybox" href="#inline1" ....
    

    then you may set your script like

    $('.fancybox').fancybox().trigger("click");
    

    (you wouldn’t need the $.fancybox.open part.)

    It will open the inline content in fancybox either on page load or clicking on the link.

    If you want to do it in a more sophisticated way, which means to launch fancybox on page load only when somebody comes to website for the first time (not every time they go back to the page during the same session) then check this https://stackoverflow.com/a/8305703/1055987

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

Sidebar

Related Questions

Quick question hopefully someone can help out here. I'm trying to copy and paste
Hopefully someone can help out here; I am trying to write a function which
Hopefully someone can help here, it's incredibly frustrating! I have a couple of iOS
Hopefully someone here can help me out - basically I have a logging class
Hopefully someone can help here. I have a ListView that is populated by a
Hopefully someone can help me out here. I'm using Visual Studio 2005 and creating
Hopefully, someone here can give me some light. I have been researching this issue
I have another beginner's question that hopefully someone can help with. I'm trying to
I'm new here and I'm very stuck. I need help. Hopefully someone can tell
I have some funny (?!?) issues with the DateTimePicker and hopefully someone can help

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.