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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:43:52+00:00 2026-05-26T06:43:52+00:00

I have some HTML code which displays 9 images with fancybox styles. I duplicated

  • 0

I have some HTML code which displays 9 images with fancybox styles.
I duplicated the HTML code between the tags and added a unique id for each duplication in the styles.css.

However, the duplicated sections do not have the fancybox working.

This is the first few lines of each section’s code. Each duplicated section is different only with “work” being “work1”, “work2” etc. I assume there is another attribute somewhere in these accompanying js files, or fancybox.js, or fancybox.css files. But I looked through those files and found nothing in common with the HTML and styles.css.

 <section class="clearfix" id="work" name="work">
    <header>
    <h2>Graphic Design</h2>
    </header>
    <ul class="projects list">

The fancybox must be initialized I guess by the next few lines:

    <li><figure><a href="images/pricing_table_3.jpg" rel="work"><img     
    src="images/work_img.jpg" alt="Image" /></a>
    <figcaption><a href="http://website.com/">Visit Livesite<span>&nbsp;&rarr;  
    </span></a></figcaption>
    </figure>

I only change the “work” attribute in that code. work1 etc.

I understand what you mean about adding that code to each #work tag, but the #work, #work1 etc. only appears in the styles.css and nowhere else in any of the other files.

I tried inserting that code and it didn’t seem to matter. I think the fundamental problem is that I can’t even find where the fancybox is being initialized on the ‘work’ block. If I could have found that, I would add the others.

I inserted the code in between the above two code examples like this:

 <script type="text/javascript">
 $("#work2 a").fancybox();
 </script>          
  • 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-05-26T06:43:53+00:00Added an answer on May 26, 2026 at 6:43 am

    You need to initialize the FancyBox on all link (…) tags on which you wish to have this behaviour. Ex:

    $("#work a").fancybox();   // initialize fancybox on "work" block
    $("#work1 a").fancybox();  // initialize fancybox on "work1" block
    $("#work2 a").fancybox();  // initialize fancybox on "work2" block
    

    Description:

    • “#work” is the ID of the container – in your case “section” block
    • “a” following it (in the ‘$(“#work a”)’ function call) is the link tag, on which you are adding the FancyBox behavior.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code which displays three images and a respective div under each
I have a joomla isntallation which displays some articles normally but when i added
I have a jquery AJAX function which retrieves some HTML markup and displays it
I have inherited some HTML code and have been asked to align the two
I have some HTML errors in my output source code, coming from one of
I have simple HTML code with some JavaScript. It looks like: <html> <head> <script
I have some PHP code that generates a calendar and then outputs html to
I have html code that looks roughly like this: <div id=id1> <div id=id2> <p>some
Let's say I have some code like this: <html> <head><title>Title</title></head> <body> <?php if (!$someCondition){
I have the following html code: <mytag> Just Some Text </mytag> And I have

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.