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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:38:03+00:00 2026-05-27T06:38:03+00:00

I need help with binding back after I unbind an element. Basically, I have

  • 0

I need help with binding back after I unbind an element. Basically, I have three anchor elements, and I want to achieve this:

When one of them is clicked, the other two can’t be clicked. Then when the user clicks the close button, I want to bind back the click event for all three links.

To unbind is not a problem, but the binding back is not working. I didn’t post any code because I think that the solution provided will work in general, not just in my case.

Is there maybe any other way to achieve what I want, but not with the use of bind/unbind or on/off?

Edit:

Here is how i have done it.The animated div is called miniContainer.This is the sample for one anchor, but it is the same thing for all three.

       //First Link         
krug1Link.click(function(element){
   if(miniContainer.hasClass('animirano')){
       return false;
   };
   element.preventDefault();
   miniContainer.stop().animate({ height:360 },{duration:500,easing: 'easeOutBack'});
   miniTekst1.animate({opacity:'1'},1200);
   polaroidMali.animate({opacity:'1'},1200);
   miniContainer.addClass('animirano');
});

//Close Mini Container
close.click(function(element){
    miniTekst1.animate({opacity:'0'},1200);
    miniTekst2.animate({opacity:'0'},1200);
    polaroidMali.animate({opacity:'0'},1200);
    polaroidMali2.animate({opacity:'0'},1200);
    miniContainer.animate({marginTop: 10, height:1},{duration:600,easing: 'easeInBack'});
    miniContainer.removeClass('animirano');
});
  • 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-27T06:38:04+00:00Added an answer on May 27, 2026 at 6:38 am

    Don’t bind and unbind to do this.

    Choose a common ancestor, and use jQuery’s selector based event delegation.

    var clickables = $('.clickable');
    
    $('#some_ancestor').delegate( '.clickable', 'click', function() {
        // to disable the others
        clickables.not( this ).removeClass('clickable');
    });
    

    Then to reenable them all, just add the class back in.

    clickables.addClass( 'clickable' );
    

    If you’re using jQuery 1.7 or later, then use .on() instead since it has event delegation built in.

    $('#some_ancestor').on( 'click', '.clickable', function() {
        // to disable the others
        clickables.not( this ).removeClass('clickable');
    });
    

    Here’s one of the solutions from the comments below.

    demo: http://jsfiddle.net/c9Ydy/3/

    <ul id="container"> 
        <li id="link1" class="box clickable">
            <a href="#">LINK ONE</a>
        </li>
        <li id="link2" class="box clickable">
            <a href="#">LINK TWO</a>
        </li>
        <li id="link3" class="box clickable">
            <a href="#">LINK THREE</a>
        </li>
    </ul>
    
    <div id="content_display">
        <button>CLOSE</button>
        <p id="link1_content">THIS IS THE CONTENT FOR THE FIRST LINK.</p>
        <p id="link2_content">THIS ONE IS FOR THE SECOND LINK</p>
        <p id="link3_content">AND THIS IS THE THIRD LINK</p>
    </div>
    

    js

    var clickables = $('.clickable'),
        display = $('#content_display'),
    
        $content, // remember the one that was clicked
        display_animation_enabled = false;
    
    $('#container').delegate( '.clickable', 'click', function() {
    
        display_animation_enabled = true;
        clickables.removeClass('clickable');
    
        if( $content ) { $content.hide(); }
    
        $content = $('#' + this.id + '_content').show();
        cycle();
    });
    display.find('p').hide();
    display.find('button').click(function() {
        display_animation_enabled = false;
        clickables.addClass( 'clickable' );
        if( $content ) { $content.hide(); }
    });
    function cycle() {
        if( display_animation_enabled ) {
            display.animate({width:300,height:300})
                   .animate({width:200,height:200}, cycle);
        }
    }
    

    css

    div.box {
        width: 50px;
        height: 50px;
        background: yellow;
        margin: 10px;
    }
    
    div.clickable {
        background: orange;
    }
    
    #content_display {
        width: 200px;
        height: 200px;
        background: yellow;
    }
    #content_display > p {
        margin: 10px;
        color: blue;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i need help with disk_total_space function.. i have this on my code <?php $sql=select
I'm so close on this one, but I need a little help. I have
I need some help here. Here is my situation: I have a binding list
Need help writing a script downloads data from google insight using c# this is
I need help on this following aspx code aspx Code: <asp:Label ID =lblName runat
I need help with this route map routes.MapRoute(Blog_Archive, Blog/Archive/{year}/{month}/{day}, new { controller = Blog,
I really don't know how to title this question, but I need some help
I need help with configuring Reporting Services. I have the ReportServer and Report Manager
I really need help on this because I lost my hopes to correct the
I need some help/guidance on WinForms data binding and I can't seem to get

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.