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

The Archive Base Latest Questions

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

I have the default anchor disabled if it has a class subnav as shown

  • 0

I have the default anchor disabled if it has a class subnav as shown in this fiddle.

I only want this disabled for the first click then I want the normal anchor functionality to be brought back. What is the best way to do this? I tried something involving the below code but this didn’t seem to work?

  $(this).unbind(event.preventDefault());

maybe something like this psuedo code?

if (click count === 0 ) {
    event.preventDefault();
}

or is there a better way to approach this?

  • 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:28:40+00:00Added an answer on June 8, 2026 at 9:28 pm

    You can pass false to one():

    $(".subnav a").one("click", false);
    

    Passing false instead of a handler is equivalent to passing a handler that returns false, effectively stopping the event’s propagation and preventing its default behavior.

    This is explained in the documentation for bind():

    In jQuery 1.4.3 you can now pass in false in place of an event
    handler. This will bind an event handler equivalent to: function() {
    return false; }
    .

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

Sidebar

Related Questions

I have anchor tags like this <div id=menu_container> <ul id=nav-bar> <li><a href=Default.aspx runat=server id=menu_item_default>Home</a></li>
I have this code: <label style=display: inline; for=default> <img class=ful src=http://www.mysite.com/default.png /> <input style=display:none
I want to be able to have default text like Enter content here... appear
I have this script: <script type=text/javascript> $(function() { $(a, top_menu).addClass(ui-widget ui-state-default); }); </script> What
I have a table that I want to add a click event to the
I have some html controls which default display value is none. I have anchor
So I want to create a tab system using only CSS. what I have
I have this code var main_container = Ext.create('Ext.container.Container', { xtype: 'container', id: id_container, anchor:
I have a strange behaviour in my ajax posting. First, I display an anchor
I have a simple jQuery click and scrollTO anchor script. I have another page,

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.