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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:22:59+00:00 2026-05-31T15:22:59+00:00

I am building a web app image gallery using FancyBox. Right now I am

  • 0

I am building a web app image gallery using FancyBox. Right now I am appending
a custom div to the popup (image) where I need to place image specific links.

How can I replace the content of the tools div everytime I click next to another image?
Or better yet, is it possible to append this div from inside the popup?

This is my code:

$(".iframe").fancybox ({

afterShow: function () {

var toolbar = '<div id="tools">LINKS COME HERE</div>';

$(".fancybox-inner").append(toolbar);

},

maxWidth    : 1200,

maxHeight   : 550,

width       : '90%',

height      : '90%',

autoSize    : false,

closeBtn  : false,

openEffect  : 'none',

closeEffect : 'none',

nextEffect: 'none',

prevEffect: 'none',

padding: 0,

scrolling: 'no'

});
  • 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-31T15:23:00+00:00Added an answer on May 31, 2026 at 3:23 pm

    I think you can create the content (of the div to be appended) for each image in a separated (hidden) section of your document like

    <div id="appendContent" style="display: none;">
     <div>content with links to be appended to the first image</div>
     <div>content with links to be appended to the second image</div>
     <div>content with links to be appended to the third image</div>
     ... etc.
    </div>
    

    The structure above assumes that you should have an equal number of images for each div in your gallery like:

    <a href="image01.jpg" class="fancybox" rel="gallery">image 01</a>
    <a href="image02.jpg" class="fancybox" rel="gallery">image 02</a>
    <a href="image03.jpg" class="fancybox" rel="gallery">image 03</a>
    etc.
    

    Additionally you can create a css selector for the appended div within your css stylesheet rather than using the .css() method (as suggested in your other question) like:

    #tools {
     position: absolute; 
     z-index: 99999;
     bottom: 0px;
     height: 20px;
     border: 1px solid #ccc;
     background: #fff;
     width: 100%;
    }
    

    …or the style settings you need.

    Then pull the content of each div and append it dynamically to the corresponding image while navigating through the gallery.

    using the afterShow callback option, you could do:

    $(document).ready(function() {
     $(".fancybox").fancybox({
      afterShow: function(){
       var toolbar = "<div id='tools'>" + $("#appendContent div").eq(this.index).html() + "</div>";
       $(".fancybox-inner").append(toolbar);
      }
     }); // fancybox
    }); // ready
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a web app where I need to get all the images
I am going to be building a web app soon where I will need
I'm building a mobile web app targeting Android users. I need to know what
I'm building a web app where users can build custom web pages that pull
So I'm building a web app using C#.NET, and would like to add a
I'm building a web app that many people will be using at the same
I'm building a web app,which actually does image compression for the user's image,I want
I am building a web app using Spring MVC and I am having a
I am building web app using Casssandra DB & Java with JSF 2.0 .
I'm building a web app using Seam, using stateful session EJBs as business components

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.