Jump to content

right click/popup


Michael.Mahon

Recommended Posts

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

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

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?

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...