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

The Archive Base Latest Questions

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

Possible Duplicate: Fancybox multiple links to same gallery without duplication I’m using fancybox 2.1.0

  • 0

Possible Duplicate:
Fancybox multiple links to same gallery without duplication

I’m using fancybox 2.1.0 with jQuery 1.8.3 to load up a gallery of images but it’s not working quite how I want it to. I have a large main image then a set of gallery thumbnails underneath. Clicking either the main image or the thumbnails opens the fancybox gallery.

The problem is the main image also features in the thumbnails, so when the gallery is launched I get the first image repeating: 1.jpg, 1.jpg, 2.jpg, 3.jpg etc.

I want the main image to trigger the gallery lightbox but not be included in it but I can’t seem to get it right. Would really appreciate any suggestions!

My markup:

<a class="product-image fancybox" data-fancybox-group="gallery" id="main-image" title="" href="1.jpg">
  <img id="image" src="1.jpg" height="320" width="320" alt="" title="" />
</a>

<ul>
  <li>
    <a class="fancybox" data-fancybox-group="gallery" href="1.jpg" title="Image 1">
      <img src="1.jpg" width="100" height="100" alt="" />
    </a>
  </li>
  <li>
    <a class="fancybox" data-fancybox-group="gallery" href="2.jpg" title="">
      <img src="2.jpg" width="100" height="100" alt="" />
    </a>
  </li>
  <li>
    <a class="fancybox" data-fancybox-group="gallery" href="3.jpg" title="">
      <img src="3.jpg" width="100" height="100" alt="" />
    </a>
  </li>

</ul>

My script:

var $j = jQuery.noConflict(); 
$j(document).ready(function() {
    $j('.fancybox').fancybox({
        nextEffect: 'fade',
        prevEffect: 'fade',
        helpers: {
            title : {
                type : 'float'

            }
        }
    });
});
  • 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:04:32+00:00Added an answer on June 17, 2026 at 9:04 am

    Try this :
    html (remove fancybox class in main img) and append rel to data-fancybox-group

        <a class="product-image" data-fancybox-group-rel="gallery" id="main-image" title="" href="1.jpg">
      <img id="image" src="1.jpg" height="320" width="320" alt="" title="" />
    </a>
    
    <ul>
      <li>
        <a class="fancybox" data-fancybox-group="gallery" href="1.jpg" title="Image 1">
          <img src="1.jpg" width="100" height="100" alt="" />
        </a>
      </li>
      <li>
        <a class="fancybox" data-fancybox-group="gallery" href="2.jpg" title="">
          <img src="2.jpg" width="100" height="100" alt="" />
        </a>
      </li>
      <li>
        <a class="fancybox" data-fancybox-group="gallery" href="3.jpg" title="">
          <img src="3.jpg" width="100" height="100" alt="" />
        </a>
      </li>
    </ul>
    

    js

      $('a.product-image').click(openFancybox);
    
    function openFancybox(){
     $.fancybox.open($(this).attr('data-fancybox-group-rel'));
    }
    

    see doc here API Methods
    [be cool,this code was not tested] ;)]
    good luck

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

Sidebar

Related Questions

Possible Duplicate: How do I make a request using HTTP basic authentication with PHP
Possible Duplicate: How to convert text to unicode code point like \u0054\u0068\u0069\u0073 using php?
Possible Duplicate: What to do when I want to use database constraints but only
Possible Duplicate: Generic methods and multiple constraints I need a generic function that has
Possible Duplicate: What is the best way to programatically detect porn images? Im currently
Possible Duplicate: Remove Datepicker Function dynamically In my web application i am using the
Possible Duplicate: Best way to determine if two path reference to same file in
Possible Duplicate: MD5 algorithm in Objective C I need to hash a string using
Possible Duplicate: What does Asynchronous means in Ajax? jQuery ajax return value Trying to
Possible Duplicate: Find length (size) of an array in jquery I have a json

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.