Is there a script I can add to a button to close a pop up layer and return to the top of the page?
Printable View
Is there a script I can add to a button to close a pop up layer and return to the top of the page?
Just tried Gary.
It is a bit tricky to understand first off but essentially you set the pop-up layer to not close automatically to be able to check what code the Close icon is using in Preview (looking at the browser status bar).
You then add an actual Close button to the pop-up layer and add that code, setting the pop-up layer to close automatically.
Finally, you add xr_top(); after the code your copied across to amble gently up to the top of the page.
All this goes into the Web Properties > Link > Link to web control box.
My example isI replaced the %27s with double quotes; either work.Quote:
javascript:xr_ppc("xr_xp4"); xr_top();
Example file: Attachment 125258
Acorn
The link returns to top but does not close the pop up. But I am probably doing something wrong.
At the top of the page is a blue rectangle with a quote and a link CLICK HERE TO READ ENTIRE REVIEW
Click this and scroll to the bottom of the review.
Thanks Acorn
Why not just paste the URL of the index page into the 'Link To Web Or Email Address' section of the button? This would make it refresh the index page.
Chris - This does indeed reload the page but not at the top. This is why it's tricky.
Are you sure you're pasting the URL and not just selecting index for the 'Link T' section?
Attachment 125261
Bingo. Simple is better. That works fine. Thanks to both of you. http://www.tovah-miriam.com/index.html (My wife's author page)
Cheers Chris, I tried # and index but stopped before trying the full URL.
Acorn
I should add that I ignored the full URL initially as this involves a session with the server regardless if everything is cached locally.
Also repeat calls to the index page probably impact browser history and Google Analytics.
The other advantage to the "code" approach is the graceful ascend to the top of the page.
Acorn
Yes, and that would be swell if that is actually what it did. It did ascend to the top of the page but it did not close the layer. Download the test file from HERE and see for yourself.Quote:
The other advantage to the "code" approach is the graceful ascend to the top of the page.