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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:23:35+00:00 2026-06-08T18:23:35+00:00

i use an roundabout script for my project menu. I have some action after

  • 0

i use an roundabout script for my project menu. I have some action after menu items click. I want to fire this actions/function after second click at this selected item. Can you help my how to do this?

This is start of my function:

$('.main_content ul li').bind({click: function(){
  • 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-08T18:23:36+00:00Added an answer on June 8, 2026 at 6:23 pm

    One way would be to manually cancel the first click:

    $('.main_content ul li').click(function() {
    
        if(!$(this).data('clicked-once')) {
            $(this).data('clicked-once', true);
            return; // cancel first execution
        }
    
        // handler body here
    
    });
    

    Demo

    Another, perhaps neater, would be to use the one method for binding the listener:

    $('.main_content ul li').one('click', function() {
       $(this).click(function() {
          // handler body here
       });
    });
    

    Demo

    Of course, if it is an actual double click you’re trying to listen to, you should use the dblclick event as Tats_innit suggests. That is, if you only want to fire an event upon two clicks in close succession. With doubleclick, three quick clicks would fire the function only once, and with the solutions above, it would fire twice. With doubleclick, two clicks with some delay between them would not cause the function to fire at all, and the seolutions above would cause it to fire once.

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

Sidebar

Related Questions

I have some user controls which I want to specify properties and methods for.
use case is simple: I want to run some boiler plate code before each
use C#,want to upload excel file on google doc. bellow syntax use to upload
I have a Javascript object that I'm trying to use as a hashmap. The
I have a form that I want to present in two states: 1) Normal
There are two queues of children waiting to use a roundabout in a playground
I have a file called something like FILE-1.txt or FILE-340.txt. I want to be
Use Elixir and have two entities -- Voter and Candidate -- with many to
Sorry that I have to describe the functionality in such a roundabout manner, but
use this code, in the Preferences activity, to know when the reset preference has

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.