Re: Close Pop up Layer and Return to Top
Quote:
Originally Posted by
gwpriester
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.
Gary, I couldn't find the popup as there were serveral dead links as this page was an extract.
Anyhow, you did not read my instructions.
When I set up your pop-up to have to use the Close icon, in the browser the close icon code is javascript:xr_ppc("xr_xp5");.
Your "CLICK TO CLOSE" link therefore needs to be javascript:xr_ppc("xr_xp5"); xr_top(); . My javascript:xr_ppc("xr_xp4"); xr_top(); was for my file.
When done, it works beautifully.
Acorn
Re: Close Pop up Layer and Return to Top
Stunning. It does work beautifully. Many thanks again.
1 Attachment(s)
Re: Close Pop up Layer and Return to Top
Nice solution Acorn.
Attached is a variant with a script at the page head to automate the layer closing, so that you don't need to enter the code to the link yourself.
It uses the global document.onmousedown event, so if you need to use that somewhere else in your document you would need merge those codes or use event listeners instead.
Re: Close Pop up Layer and Return to Top
Thanks Siran. I would like to see Xara developers add this capability to the layer menu.
1 Attachment(s)
Re: Close Pop up Layer and Return to Top
The above example didn't work with stickie buttons, this one does.
Re: Close Pop up Layer and Return to Top
Re: Close Pop up Layer and Return to Top
I have also checked Sticky Buttons and my approach works for these too: Sticky & Stick at Top & Stick at Edge. And with Variants.
Acorn
Re: Close Pop up Layer and Return to Top
Acorn, I'm quite sure the manual method you provided is more robust. It is quite unlikely Xara changes the names of internal procedures so your method should work for future versions as well, while the script approach relies on the structure of the HTML Xara creates, which might very well change in the future.
So anyone willing to change the code in the link address is strongly encouraged to use your method.
Re: Close Pop up Layer and Return to Top
Quote:
Originally Posted by
siran
Acorn, I'm quite sure the manual method you provided is more robust. It is quite unlikely Xara changes the names of internal procedures so your method should work for future versions as well, while the script approach relies on the structure of the HTML Xara creates, which might very well change in the future.
So anyone willing to change the code in the link address is strongly encouraged to use your method.
siran, thank you for the endorsement; I was using my approach as a counterpoint to yours simply because it was simpler to visualise. I applaud your deeper understanding of the mechanics. I can understand your coding but rarely can I create it from a concept.
My approach fails when buttons and pop-ups are removed so as ever testing is paramount.
Acorn