Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

right mouse button???

Status
Not open for further replies.

pichi

Programmer
Nov 12, 2000
156
EC
hi, i want to know how when the user click with the right button of the mouse, and how i can know what option of the drop down menu he/she chooses?

can anybody help me!!

i want this because i am working with frames and i want to click on a link and when the user clicks with left button opens a page in the same window (with href) but when he/she clicks with his/hers right button and chooses "open link in other window" use the window.open("http...").

hope you can help me!!

Pichi
 
"but when he/she clicks with his/hers right button and chooses "open link in other window" use the window.open" ---> you want to override this function right ?? i'm afraid you can't do so in javascript, as it's specific to the system & browser ... why do you want to rewrite it anyway ??
 
No,, i don't want to override this function, all i want to do is know what option of the dropdown menu (right click) the user chooses, so if the user choose the option "open link in a new window" i can execute a javascript function!
that it!! i know that i can't override this function!!
hope i make myself clear!!

thanks

Pichi
 
-> you can know which option is selected but as far as i know, you can't do so in javascript (it's very easy tho in vc++ or vb)
-> are you aware that even if you manage to do what you want to the way you want it to, it still lets the user open a new window using 'normal' menus or any other means; and that your users will HAVE TO use windows and no other os ?
-> i still don't understand why you want to execute window.open(...) when a user clicks &quot;open in a new window&quot; : it's already done ! what do you want to do *exactly* ? couldn't it be done in the opening page (<body onload=&quot;what you wanted to do in your almost not overriden function&quot;>) ? it's easier to detect (in javascript) how was the window open than how will the window be open (i mean, &quot;if (window.opener)&quot; is far more easier than trying to detect which click was done ...) - please try to explain better, or show us the jscript function you want to call, as i'm sure there's an easy work around
 
Hi iza, let me explain better, so i hope you can help me!!
look i have a web page, with two frames , one on left and another on right, let's called frameL and FrameR, in hte frameL, i have two frames, the botton frame is a navegation bar and the top frame is a a page with a few options , one of them is the reload button, which reload's the page in frameR, other options are links to other pages, that i want to open in frameR when the user clicks on them (for now i am using on the onclick event the following code
top.location=&quot; , but the user can use his/her rigth button and open a new window, when this happen anohter browser window opens but with the default home page of the browser, and that's wrong for me, because i want that the page for the link opens in a new window, and for that i new to know when the user chooses &quot;open link in new window option&quot;, o i can write a code for that!!

hope you can help me, iza!!

thanks!!
pichi
 
if you could use <a href=&quot;whatever&quot; target=&quot;frameR&quot;> that would solve it, as even clicking on the right button and choossing &quot;open in a new window&quot; will lead &quot;whatever&quot; to be displayed in the new window, not the default home page.
now if you have to use top.location .... there's no workaround - i mean, that's the way browser behave !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top