attaching javascript calls to window close

Page: 1

Author Post
dmmunro
Guest
Hi folks.
Just curious if anyone has had the need to attch a js script to the close button in combination to its usual behaviour? if so how did you do it.
cheers
M
Administrator
Registered: Aug 2008
Posts: 3382
New version (1 to 3 days away from release) has callback functions that you can define for different events such as beforeBoxEnd and afterBoxEnd. In v3.24, the best approach might be to use the loadPageOnClose capability (see the docs). You can trick this into running javascript by using a url syntax like javascript:doMyFunction(); instead of the more traditional page path that would normally be assigned to that option.
dmmunro
Guest
Thankyou. Actually this won't work for me since the the login screen is proceeded by a splash screen that tells them that the page is protected. this floatbox window gets resized to the login screen. When the user logs in successfully the box closes and the protected material loads automatically. since its the same floatbox, the loadPageOnClose:self is appropriate for the first condition and not for closing the boxes via the close button. The solution was to remove the close button and add a close button to the body of the loaded content. By creating a separate script that gets called by the close button and by using top.fb.end(true); , the box will close via the sudo close button. Sneaky but it works.

Page: 1