javascript on close window problem
hi have javascript runs when user closes pop-up window using x (i.e instead of loggin out using button)
this works fine without problems.
however need make work second set of pages within set of frames.
initially tried referencing javascript on actual frameset page didn't seem work placed javascript inside 1 of frames , altered script reference top. instead of window.
(i.e stuff window.close() became top.close())
again working fine except following part:
xwidth=window.document.body.offsetwidth-window.event.clientx
yheight=window.event.clienty
if(xwidth<=30&&yheight<0)
{
// alert("closed2")
top.location.href="pop_chat_main_logout.asp";
top.close();
}
in pages don't have frames.. works out user's mouse , can make pretty accurate guess it's within x button , therefore should run.
however not seem function correctly when within frame.
i think it's getting confused frames stats it's getting (i.e mouse when pressed) not same coordinates when not in frame doesn't run..
does make sense , how fix it?
james
this works fine without problems.
however need make work second set of pages within set of frames.
initially tried referencing javascript on actual frameset page didn't seem work placed javascript inside 1 of frames , altered script reference top. instead of window.
(i.e stuff window.close() became top.close())
again working fine except following part:
xwidth=window.document.body.offsetwidth-window.event.clientx
yheight=window.event.clienty
if(xwidth<=30&&yheight<0)
{
// alert("closed2")
top.location.href="pop_chat_main_logout.asp";
top.close();
}
in pages don't have frames.. works out user's mouse , can make pretty accurate guess it's within x button , therefore should run.
however not seem function correctly when within frame.
i think it's getting confused frames stats it's getting (i.e mouse when pressed) not same coordinates when not in frame doesn't run..
does make sense , how fix it?
james
jamesy wrote:
> hi have javascript runs when user closes pop-up window using
> x (i.e instead of loggin out using button)
>
> works fine without problems.
>
> need make work second set of pages
> within set of frames.
>
> tried referencing javascript on actual frameset page
> didn't seem work placed javascript inside 1 of frames
> , altered script reference top. instead of window.
>
> (i.e stuff window.close() became top.close())
>
> again working fine except following part:
>
> xwidth=window.document.body.offsetwidth-window.event.clientx
> yheight=window.event.clienty
> if(xwidth<=30&&yheight<0)
> {
> // alert("closed2")
> top.location.href="pop_chat_main_logout.asp";
> top.close();
>
> }
>
>
> in pages don't have frames.. works out user's
> mouse , can make pretty accurate guess it's within x
> button , therefore should run.
>
> not seem function correctly when within frame.
>
> think it's getting confused frames stats it's getting
> (i.e mouse when pressed) not same coordinates when not
> in frame doesn't run..
>
> make sense , how fix it?
>
> james
>
why not use own "x" image? (mac users' "x" red bubble in
top left of window)
mick
> hi have javascript runs when user closes pop-up window using
> x (i.e instead of loggin out using button)
>
> works fine without problems.
>
> need make work second set of pages
> within set of frames.
>
> tried referencing javascript on actual frameset page
> didn't seem work placed javascript inside 1 of frames
> , altered script reference top. instead of window.
>
> (i.e stuff window.close() became top.close())
>
> again working fine except following part:
>
> xwidth=window.document.body.offsetwidth-window.event.clientx
> yheight=window.event.clienty
> if(xwidth<=30&&yheight<0)
> {
> // alert("closed2")
> top.location.href="pop_chat_main_logout.asp";
> top.close();
>
> }
>
>
> in pages don't have frames.. works out user's
> mouse , can make pretty accurate guess it's within x
> button , therefore should run.
>
> not seem function correctly when within frame.
>
> think it's getting confused frames stats it's getting
> (i.e mouse when pressed) not same coordinates when not
> in frame doesn't run..
>
> make sense , how fix it?
>
> james
>
why not use own "x" image? (mac users' "x" red bubble in
top left of window)
mick
More discussions in Dreamweaver support forum
adobe
Comments
Post a Comment