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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:30:14+00:00 2026-06-10T03:30:14+00:00

In my website i got a button. If u click it, a dropdown will

  • 0

In my website i got a button. If u click it, a dropdown will come. If you click it again. It’ll disappear.
I use the jQuery function TOGGLE for it.
Now i want the following. If you move out of the dropdown for 2 seconds, or click somewhere outside the dropdown. it has to disappear again.

Is there a way to switch the Toggle function with a timer and click outside?
This is the code:

$(Ar3).addClass(aU);
$('.ContextMenuLink').toggle(function () {
    $(hP).css('background', '#fff');
    $('.ContextMenuTxt').css('color', '#6b8592');
    $(CM).css('display', 'block');
    $(Ar3).addClass(aD).removeClass(aU);
}, function () {
    $(hP).css('background', 'none');
    $('.ContextMenuTxt').css('color', '#fff');
    $(CM).css('display', 'none');
    $(Ar3).removeClass(aD).addClass(aU);
});
  • 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-10T03:30:16+00:00Added an answer on June 10, 2026 at 3:30 am

    Just set your timer to issue a $('.ContextMenuLink').click().

    As for the outside click, I would do something like this:

    $(document).click(function outSideClick(e){
        if(e.target != $('.ContextMenuLink')[0]){
            $('.ContextMenuLink').click();
            $(document).unbind('click',outSideClick);
        })
    });
    

    You should also remember to unbind this event whenever you close the drop-down by clicking on it or using the timer.

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

Sidebar

Related Questions

I've got a jQuery Mobile website with a PayPal custom button. The button sits
I've got two websites aaa.com and bbb.com. I want to, on button click, postMessage
I've got a website done in Django 0.96 (done in 2007), and now we
So I have a website where I want to put the subscribe button, here
I have an issue regarding link button, On my website i have got a
I am here as a developer of a website. My website got different modules
In my website I got like 10GB of images but 90% of that images
I got a website which contains a lot of projects with each project containing
I've got a website running on Amazon Web Services that is deployed using Elastic
I've got a website with the following links www.mydomain.com/NiceUrl1.html www.mydomain.com/ blog.html www.mydomain.com/AnotherNiceUrl.html What .htaccess

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.