/    Sign up×
Community /Pin to ProfileBookmark

a newbie: how to disable the default context menu?

thanks anyone much for help!

I’m just gonna implement context menus for different nodes of my navigation tree for the page, i guess i knew how to popup those different context menus now, but i don’t know how to disable the default context menu, i guess it is something like this:

document.onContextMenu = …;

can someone please tell me what should be the … ?
thanks a lot!

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@pyroAug 26.2003 — return false;

But, you may want to rethink disabling it... Generally speaking, it is a bad idea to mess with the users settings/browser.
Copy linkTweet thisAlerts:
@AdamBrillAug 26.2003 — Take a look at the attached script. You should be able to use that to help you...

However, Pyro is right. Think twice before messing with the users menu... ?

[upl-file uuid=ddaba1df-c719-4724-802d-b4fdaeed6f5b size=1kB]custom_menu.zip[/upl-file]
Copy linkTweet thisAlerts:
@raysunauthorAug 26.2003 — yeah, i knew it is a bad idea, actually it wasn't my own idea at all, just our client wants it, and I had been suggesting them not to do so, but they said they'd like to have a try, so...

anyway, thanks much guys!
×

Success!

Help @raysun spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.11,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,
)...