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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:06:31+00:00 2026-05-15T12:06:31+00:00

I am loading images externally using jQuery load function.. but not able add light

  • 0

I am loading images externally using jQuery load function.. but not able add light box..

am very new to jquery.

var href = $('#images').attr('href');

$('#images').click(function(){
    var toLoad = $(this).attr('href')+' #content';

    $('#content').hide('fast',loadContent);
    $('#load').remove();        
    $('#wrapper').append('<span id="load">LOADING...</span>');
    $('#load').fadeIn('normal');        
    window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-3);    

    function loadContent() {
        $('#content').load(toLoad,'',showNewContent());

    }
    function showNewContent() {
        $('#content').show('normal',hideLoader());
    }
    function hideLoader() {
        $('#load').fadeOut('normal');
    }
    return false;
});

this function is in $(document).ready() and now i need to add function below so that images dynamically loaded become part of lightbox.

    $('.gallery a').lightBox({txtImage: 'Design'})

What am doing is… calling the file portfolio.php and taking the html inside the #content div and loading it in the #content div in the page the user is viewing.

Please help with code if possible.

  • 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-15T12:06:31+00:00Added an answer on May 15, 2026 at 12:06 pm

    This assumes that .gallery is a child of #content here. You would add it to the showNewContent() function, like this:

    function loadContent() {
        $('#content').load(toLoad,'',showNewContent);
    
    }
    function showNewContent() {
        $('#content').find('.gallery a').lightBox({txtImage: 'Design'})
                     .end().show('normal',hideLoader);
    }
    function hideLoader() {
        $('#load').fadeOut('normal');
    }
    

    Make sure to call showNewContent as the callback, not showNewContent(), (no parenthesis!), otherwise it’s actually executing that function right then and trying to assign the result to the callback, not the function itself, and so not running it when the animation is complete.

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

Sidebar

Related Questions

I am using jquery's ajax loading function to load an external html. The external
I'm using Mika Tuupola's Lazy Load plugin http://www.appelsiini.net/projects/lazyload to delay loading images as you
When loading images using Loader, what's the preferred way to add the image to
I am using following code for loading images from server using following code.When i
I am using JSF and have made a custom servlet for loading images dynamically.
Using JQuery, I am loading a div from an external HTML page into fancybox
Javascript and jQuery (Fancybox) question I'm using the Javascript function below for Twitter sharing
Rigth now, I am using this function to load content from a different page
I'm using the Loader class in AS3.0 to load external images. I need to
During my game loop I am constantly loading images using BitmapFactory.decodeResource(getResources(), R.drawable.objectx); Most of

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.