Fp2000 and using Mouseover and Mouseout

E

Edwin Hannan

Hi all

I am trying to control a popup window using mouseover and mouseout.

I can pop a window when a mouseover event occurs (calls to my javascript
edpop() function)

but I cant get to close the popup window on the mouseout event

i thought i was storing the handle of the new popup window in the var win?


here is my javascript code
*************************************

javaScript in head

var win; //global var

function removewindow()
{
win.close(); // and why wont the popup close on mouseout????
}

function edpopup()
{
win = window.open("./answers/ccjs.htm","","height=200,width=450"); //

}

End JavaScript
*****************************************

<P onmouseout="removewindow()";
onmouseover="edpopup();">
Move the mouse pointer over this text, and then move it elsewhere
in the document. Move the mouse pointer over this text, and then
move it elsewhere in the document.



edpopup works
remove window does not work?

Why? can anyone help with this

cheers

Ed
 
T

Thomas A. Rowe

You can't closed it, as the focus is not longer on the calling page with the
original JavaScript.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
J

jon spivey

This would probably be the simplest way
<script type="text/javascript">
function openWin(url){
document.mywin = window.open(url,'mywin','width=200,height=200')
}
function closeWin(){
document.mywin.close()
}
</script>
<p onmouseover="openWin('page.htm');" onmouseout="closeWin();">some text</p>

Although there's no support for NN4 because of mouseover on <p> tags.
 
T

Thomas A. Rowe

Jon,

Is this limited to only being useable via the <p> tag?

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
E

Edwin Hannan

Peter

This doesnot work on the mouseout (must be as Thomas noted - that the popup
window cannot be closed from the parent window) but the timer code works ok
and will close the popup

cheers

Ed
 
T

Thomas A. Rowe

Edwin,

See Jon Spivey reply/sample script, which does work. The only issue I see
with doing popup on mouse over/out, is that the user must keep the cursor on
the link to be able to view/read the content.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
E

Edwin Hannan

Jon

The mouseout event does not close the popup window, even though the handle
of the target popup window is being saved, again it appears as though popups
cannot be closed from the window they were called from???

Unless my IE 6 on win2k is doing really strange things?

I will just put a button on the popup window to allow the closure.

cheers

Ed
 
E

Edwin Hannan

Thomas

I cannot get this to work, popup ok but no action on mouseout, do you have
this working? if so can you let me know how?

cheers

Ed
 
J

jon spivey

I'd like to see this - can you sling a page up on the web? Popups can
certainly be closed from the window they're called from as in the example I
posted up yesterday which works fine.
 
J

jon spivey

No, in modern browsers any tag can accept mouse events (onmouseover, onclick
etc). NN4 only accepts mouse events on <a> tags - or maybe <div> if you
attach the handler with script
 
E

Edwin Hannan

Jon

I will put a page up soon, bear with me, I will give you the url soon.


cheers

Ed
 
E

Edwin Hannan

Jon

I have manged to test the www.metrofinance.co.uk/test/jonspivey.htm page on
a win 98 machine using IE 5.0 and your script works as advertised which is
fantastic..but my dev machine a win 2k pro sp4 and IE 6.02800 will not
allow a close on mouseout?????

I have just accessed using IE 6.026000 on a win 2k server sp3 and all is ok

its my bloody machine ...but why????

cheers

Ed
 
J

jon spivey

Well I don't know what to say about that :) Your page works fine for me on
win2003 server/ie6 and xp pro/ie6 - don't have a win2k box to test on, my
host upgraded to win2003/iis6 last week so I upgraded my dev server then.
There's no reason I can think of why it wouldn't work on any browser/os
combination

Maybe someone else has some ideas.......

Cheers,
Jon
 
E

Edwin Hannan

Jon
Thanks for your time on this matter, the important thing is that it works, I
will sort out my browser on my machine.

Cheers

Ed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top