Welcome to TalkGraphics.com
Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,503

    Default Close Pop up Layer and Return to Top

    Is there a script I can add to a button to close a pop up layer and return to the top of the page?

  2. #2
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,822

    Info Re: Close Pop up Layer and Return to Top

    Quote Originally Posted by gwpriester View Post
    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 is
    javascript:xr_ppc("xr_xp4"); xr_top();
    I replaced the %27s with double quotes; either work.

    Example file: JS_Popup Close & Top.xar

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  3. #3
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,503

    Default Re: Close Pop up Layer and Return to Top

    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
    Attached Files Attached Files

  4. #4
    Join Date
    Dec 2018
    Location
    Australia
    Posts
    1,776

    Default Re: Close Pop up Layer and Return to Top

    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.

  5. #5
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,503

    Default Re: Close Pop up Layer and Return to Top

    Chris - This does indeed reload the page but not at the top. This is why it's tricky.

  6. #6
    Join Date
    Dec 2018
    Location
    Australia
    Posts
    1,776

    Default Re: Close Pop up Layer and Return to Top

    Are you sure you're pasting the URL and not just selecting index for the 'Link T' section?

    Click image for larger version. 

Name:	Web Properties.jpg 
Views:	111 
Size:	61.1 KB 
ID:	125261

  7. #7
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,503

    Default Re: Close Pop up Layer and Return to Top

    Bingo. Simple is better. That works fine. Thanks to both of you. http://www.tovah-miriam.com/index.html (My wife's author page)

  8. #8
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,822

    Default Re: Close Pop up Layer and Return to Top

    Cheers Chris, I tried # and index but stopped before trying the full URL.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  9. #9
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,822

    Default Re: Close Pop up Layer and Return to Top

    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
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  10. #10
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,503

    Default Re: Close Pop up Layer and Return to Top

    The other advantage to the "code" approach is the graceful ascend to the top of the page.
    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.

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •