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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:15:21+00:00 2026-05-25T06:15:21+00:00

When we click with right mouse button on a any site link, there’s a

  • 0

When we click with right mouse button on a any site link, there’s a dropdown menu. One of the options here is “Open in new window”. For some reasons, I need to disable this possibility for all site links. Is it possible?

Thanks in advance.

UPDATE

The reason for doing this

The site menu has 2 types of menu items: ordinary links to pages and fake links, that cause popup window with certain information. I have a jquery function, that shows this popup and returns false for the link. And when a user “Open in new window” some of fake links, page reloads, but popup does not appear. And the user is looking at the empty page. That’s not good I think 🙂

  • 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-25T06:15:21+00:00Added an answer on May 25, 2026 at 6:15 am

    UPDATE

    It’s possible to disable context menu on any element we want:

    $('selector').contextmenu( function() {
        return false;
    });
    

    To disable context menu on the page completely, we can use the following:

    $('*').contextmenu( function() {
        return false;
    });
    

    OLD ANSWER

    OK, guys, if we can’t change browsers specific features, then we have to think of some other way. As for me, the most suitable idea has been suggested by Quentin. So I wrote a little jquery script to replace all links, that I need to be fake, with span elements.

    // transform links with .fake class only
    $('.nav >li > a.fake').each(function () {
    
        // save all necessary link information
        var href = $(this).attr('href');
        var text = $(this).html();
    
        // add fake span
        $(this).after('<span>'+text+'</span>');
    
        // save new span into a variable and after this we can remove the link
        var mySpan = $(this).siblings('span');
        $(this).remove();
    
        // emulate link default behaviour
        mySpan.click(function () {
            window.location.href = href;
        });
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to turn off the right click button on mouse by
I made context menu for UltrawinGrid, when i click right mouse button then the
Using JavaScript, how can I distinguish between a left and right mouse button click
Currently I press right mouse button to select Copy file path to clipboard menu.
I need a cross browser way of capturing the right mouse click, preventing the
I want to create a right click context menu for my textboxes to provide
I want to make a right click menu for my winforms app. It will
So let's say I'm trying to click a link in the QWebView, here is
I have written the code to display a context menu on right click of
Possible Duplicate: Jquery: detect if middle or right mouse button is clicked, if so,

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.