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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:06:48+00:00 2026-06-08T21:06:48+00:00

I’m trying to put together a microsite which uses Jquery for a number of

  • 0

I’m trying to put together a microsite which uses Jquery for a number of animations. There are 4 links on the page which each open up a lightbox.

I want the lightbox to appear using a ‘show’ function after the background darkens – at the moment this is working fine. However when the lightbox is closed I’d like it to hide before the dark background fades out. For some reason, when the ‘hide’ function is executed, the lightbox panel extends to the bottom of the page before shrinking, and the background fades simultaneously, rather than waiting until the hide function is complete (despite the fadeout having been written into the callback of the hide)

I’m new to Jquery so I know I’ve got it wrong somewhere, but if someone could help I’d be most grateful.

The Jquery code for one of the lightbox panels is written below. To see the microsite as it stands at the moment and to view the HTML source, go to:

http://testing.xenongroupadmin.com/whatis/pfi

So far I’ve only written the code for one of the lightboxes – click on the top left box entitled ‘Who needs to know’.

Any help would be most appreciated!

Thanks!

JQuery Code

$(document).ready(function(){

$("a#show-whopanel").click(function(){
 $("#lightbox, #who-panel").fadeIn(300, function(){
  $("div#animation1").show(600);
  })
 })

$("a#close-panel").click(function(){
 $("div#animation1").hide(600, function(){
  $("#lightbox, #who-panel").fadeOut(300);
  }
 );
})

})

  • 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-08T21:06:49+00:00Added an answer on June 8, 2026 at 9:06 pm

    At a more general level, when debugging jQuery, it pays to remove the callback function and see whether the basic effect is working.

    So, your closure is as follows:

    $("a#close-panel").click(function(){
       $("div#animation1").hide(600, function(){
           $("#lightbox, #who-panel").fadeOut(300);
       });
    });
    

    It basically says: on click, (1) hide animation1, and when the hide has finished, (2) fadeout lightbox and who-panel.

    To debug, you want to check what this does:

    $("a#close-panel").click(function(){
       $("div#animation1").hide(600);
    });
    

    And then check what this does:

    $("a#close-panel").click(function(){
           $("#lightbox, #who-panel").fadeOut(300);
    });
    

    Then you’ll know what’s doing what, and which effect is making the div increase in size before it disappears.

    You’re also missing some semi-colons, although that should be OK.

    EDIT:
    Looking more closely, why are you using a callback at all? Don’t you just want to get rid of the lightbox and who-panel? Why are you hiding animation1? If the who-panel is faded out, you won’t be able to see animation1 anyway!

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
I am trying to loop through a bunch of documents I have to put
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:
I would like to run a str_replace or preg_replace which looks for certain words

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.