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

  • Home
  • SEARCH
  • 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 3599126
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:19:44+00:00 2026-05-18T20:19:44+00:00

This is written in an external .js with jquery… I have two windows that

  • 0

This is written in an external .js with jquery…

I have two windows that slide in and out of view like:

$(document).ready(function() {
  // hides gallery1 as soon as the DOM is ready  
  $('#gallery1').hide();  
  // shows the menu on click   
  $('#showgal1').click(function() {  
    $('#gallery1').delay(490).show('slide', {direction:'left'});
    $('#gallery2').hide('slide', {direction:'right'});
    //need code to disable showgal1 and enable showgal2
  });
  $('#showgal2').click(function() {  
    $('#gallery2').delay(490).show('slide', {direction:'right'});
    $('#gallery1').hide('slide', {direction:'left'});
    //need code to disable showgal2 and enable showgal1
  });
});

‘gallery1’ and ‘gallery2’ are DIV’s with flash image galleries and ‘showgal1’ and ‘showgal2’ are id’s of anchors…

looks like

<a href="#" id="showgal1">gallery 1</a>

I cannot find a way to disable the .click function when one is clicked and re-enable the other…

i want to disable ‘showgal1’ by default and when ‘showgal2’ event takes place it removes the attribute and makes ‘showgal2’ disabled until ‘showgal1’ is clicked…

the .attr('disabled','disabled') hasn’t worked yet…

  • 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-18T20:19:45+00:00Added an answer on May 18, 2026 at 8:19 pm

    So you want to stop any action when a showgal is clicked if the associated gallery is already visible?

    $('#showgal1').click(function(){
        if($('#gallery1').is(":visible"))
           return false;
    
        $('#gallery1').delay(490).show('slide', {direction:'right'});
        $('#gallery2').hide('slide', {direction:'left'});
    
    });
    
    $('#showgal2').click(function(){
        if($('#gallery2').is(":visible"))
           return false;
        $('#gallery2').delay(490).show('slide', {direction:'right'});
        $('#gallery1').hide('slide', {direction:'left'});
    
    });
    

    The first 2 lines of each click function will stop the function if the respective gallery is already visible.

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

Sidebar

Related Questions

This is written in an external .js with jquery... I have two windows that
I have written an external script that needs to run after DOM is ready
I have some jQuery code that intercepts links clicked on a page: $(document).ready(function() {
Edit: This question was written in 2008, which was like 3 internet ages ago.
I've written my first JQuery plugin and one of it's dependancies is an external
I'm working in XCode and I've also written an external editor tool that generates
I have written some code in Java that will decode a SHOUTcast stream and
This is written in PHP, but it's really language agnostic. try { try {
I've written this very simple function to replace a file extension using LINQ in
I've written this to try and log onto a forum (phpBB3). import urllib2, re

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.