Michael.Mahon Posted February 21, 2006 Share Posted February 21, 2006 Hi, im very new to javascript I was wondering if this is possible:I know you can disable right clicking, and i know java can make popup windowsis there a way to disable right click and when they right click it will open the popup window??any help would be appreciated Link to comment Share on other sites More sharing options...
scott100 Posted February 21, 2006 Share Posted February 21, 2006 Have a look here, i think this is only available in IE http://www.dynamicdrive.com/dynamicindex9/noright.htm Link to comment Share on other sites More sharing options...
Michael.Mahon Posted February 21, 2006 Author Share Posted February 21, 2006 Have a look here, i think this is only available in IE http://www.dynamicdrive.com/dynamicindex9/noright.htm<{POST_SNAPBACK}> thanks for the help, but that just disables rightclick bringing up an alert window, i want it to bring up like another HTML file as a popup window Link to comment Share on other sites More sharing options...
Pollux Posted February 21, 2006 Share Posted February 21, 2006 That code does show you how to capture a right mouse click though. But instead of opening an alert, you need to call a function to perform the popup. If it's just a new html window you want to popup, then the function will need to contain a statement something like this: window.open("somepage.html", "windowname", "width=300, height=150"); Theres lots of other properties you can use as well as width and height. You can control whether toolbars, menubars and scrollbars are shown, set screen position etc. You'll be able to find a complete list easily with a quick search on google.If I've misunderstood what you're looking for as well, then try explaining again and we'll see if we can be more helpful. Link to comment Share on other sites More sharing options...
Michael.Mahon Posted February 21, 2006 Author Share Posted February 21, 2006 ok ty i think that is what i wanted, ty both for the helpalso i just thought of one more thing, is there a way to have on mouseover a window popups up? Link to comment Share on other sites More sharing options...
Pollux Posted February 21, 2006 Share Posted February 21, 2006 If you're still talking about the HTML window (that window.open will give you) popups, then the answer's "sort of". The content of the window that is opened is simply another HTML document so you can put any onmouseovers you want within that - on images, tables etc. But you cant put an onmouseover on the actual window, because the window is part of the browser. Link to comment Share on other sites More sharing options...
scott100 Posted February 21, 2006 Share Posted February 21, 2006 ok ty i think that is what i wanted, ty both for the helpalso i just thought of one more thing, is there a way to have on mouseover a window popups up?<{POST_SNAPBACK}> Do you mean instead of right clicking, ie put the mouse over an image and a pop up appears? Link to comment Share on other sites More sharing options...
Pollux Posted February 21, 2006 Share Posted February 21, 2006 Ah, yeah! Think you're right there Scott. What is it you want to create the onmouseover effect on Michael? Link to comment Share on other sites More sharing options...
Chocolate570 Posted February 21, 2006 Share Posted February 21, 2006 First michael, add this to the tag that, when mouseovered, should bring up the pop up: onmouseover="popUp()" Then, put this in your head section: <script type="text/javascript">function popUp(){window.open("somepage.html", "windowname", "width=300, height=150");}</script> And remember to edit the window.open() function. Hope that helps!Choco Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now