Welcome to TalkGraphics.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Sep 2005
    Location
    Moncton, NB Canada
    Posts
    77

    Default A Text-Link question

    Hi Everybody,

    I'm trying to learn how to do the following.

    I plan to have a text link on a page, say "index.htm". Rather than link to a different page, say "email.htm" ... I want to link to a specific PopUp that is contained in email.htm.

    How do I need to approach that?

    Many thanks,

    -Paul-

  2. #2
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    14,360

    Lightbulb Re: A Text-Link question

    Paul, I played with this ages ago.

    JQ - Scroll To Anchor on Popup Layer.xar

    You start with giving an object on your pop-up layer a Name.
    This it is Anchor - I called mine 'pop'.

    I then checked that my pop-up layer was the seventh from the bottom.
    In JavaScript this counts as 6 as JS counts from 0.

    I added some jQuery code to the Website Code (body).
    I included the jQuery Library by adding the Name UsesJQuery to any object. [There is a typo in the design file]

    I finally created a Grey button with code: javascript: xr_cpu(6); scroller('#pop', 5000);
    This pretends it is the normal pop-up button click (the red box).
    Then a 5-second slide to place the Anchor at the top of the browser.

    You can hide the Red button but it must exist.
    You need to check the layer you are popping.
    You can change the 5000 (milliSeconds) to any value you want.

    I cannot recall any simpler approach but I would love finding one.

    Acorn
    Last edited by Acorn; 20 October 2021 at 07:50 PM.
    Acorn - installed and active Xara software: Cloud+/Pro+, XDPX, XWD Premium 15 & 12, XPGD10, X3D7, Xara Xtreme 5, back through time (to CC's Artworks).
    Raise software faults with MagiXara: http://support.magix.net/; if Cloud+/Pro+: https://xara.com/contact-us/

  3. #3
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    14,360

    Info Re: A Text-Link question

    If you can handle the jQuery, this code works for the Grey button, without you having to work out what layer the Red button is opening:

    javascript: xr_cpu($('#pop').parent().parent()[0].id.split('xr_xp')[1]); scroller('#pop', 5000);

    Acorn
    Acorn - installed and active Xara software: Cloud+/Pro+, XDPX, XWD Premium 15 & 12, XPGD10, X3D7, Xara Xtreme 5, back through time (to CC's Artworks).
    Raise software faults with MagiXara: http://support.magix.net/; if Cloud+/Pro+: https://xara.com/contact-us/

  4. #4
    Join Date
    Apr 2018
    Location
    London
    Posts
    680

    Default Re: A Text-Link question

    Quote Originally Posted by Acorn View Post
    If you can handle the jQuery, this code works for the Grey button, without you having to work out what layer the Red button is opening:

    javascript: xr_cpu($('#pop').parent().parent()[0].id.split('xr_xp')[1]); scroller('#pop', 5000);

    Acorn
    Very neat Acorn, it works for multiple popups which saves the hassle of checking 'xr_cpu(n)' in the bottom left of the browser each time. Looks like it works across variants too.

    Could you though please explain the string and how the id spilt works wrt 'xr_xp'?

    Thanks

    Gary

  5. #5
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    14,360

    Default Re: A Text-Link question

    Quote Originally Posted by Initiostar View Post
    Very neat Acorn, it works for multiple popups which saves the hassle of checking 'xr_cpu(n)' in the bottom left of the browser each time. Looks like it works across variants too.
    Could you though please explain the string and how the id spilt works wrt 'xr_xp'?
    Thanks Gary
    Gary, pretending to be a computer:

    • Go and find the Anchor (id) called 'pop' in the Document Object Model. [<span ... id="pop"...]
    • Now climb to its grandparent [<div ... id="xr_xp6"...]; it is always xr_xp(something) - this something number is which layer it is on, here it is 6 - the seventh layer.
    • Now remove the known bit to get the (something) ["xr-xp6".split('xr_xp')[1]) ==> ['', '6']; an array where we only need the second element [1] ==> 6]
    • Finally, "Fire up the Quattro" with xr_cpu(6) to make Layer 6 visible.

    Acorn
    Acorn - installed and active Xara software: Cloud+/Pro+, XDPX, XWD Premium 15 & 12, XPGD10, X3D7, Xara Xtreme 5, back through time (to CC's Artworks).
    Raise software faults with MagiXara: http://support.magix.net/; if Cloud+/Pro+: https://xara.com/contact-us/

  6. #6
    Join Date
    Apr 2018
    Location
    London
    Posts
    680

    Default Re: A Text-Link question

    Thanks Acorn, understood

    Gary

  7. #7
    Join Date
    Sep 2005
    Location
    Moncton, NB Canada
    Posts
    77

    Default Re: A Text-Link question

    I'm guessing I wasn't too clear about what I want to do.

    In a nutshell, I have a form embedded in a PopUp layer on my "contact.htm" page. That PopUp is named PopUp-1 and it works fine. I'm thinking that PopUp-1 is stored as an object and should be reusable. I should be able to link to it from anyplace on the "index.htm" page (or any other htm page) without a lot of programming.

    Isn't it just as simple as I think?

    Paul

  8. #8
    Join Date
    Apr 2018
    Location
    London
    Posts
    680

    Default Re: A Text-Link question

    Quote Originally Posted by Paul Bruneau View Post
    I'm guessing I wasn't too clear about what I want to do.

    In a nutshell, I have a form embedded in a PopUp layer on my "contact.htm" page. That PopUp is named PopUp-1 and it works fine. I'm thinking that PopUp-1 is stored as an object and should be reusable. I should be able to link to it from anyplace on the "index.htm" page (or any other htm page) without a lot of programming.

    Isn't it just as simple as I think?

    Paul
    The simplest (no code) option I would use would be to replicate (copy and paste but not repeat) the popup with your embedded form, on those pages that you want it to be available.

    You can then position each popup on each page as required. There are other ways to do this by accessing a popup on one page from another page, but it requires some code (thatís my understanding anyway).

    Iím guessing here this is a contact form, but were it a more general form, you could have it on a separate page and access it either from the menu or a link on a page. It could open your Ďformí page in a new window.

    Gary

  9. #9
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    14,360

    Default Re: A Text-Link question

    Quote Originally Posted by Paul Bruneau View Post
    I'm guessing I wasn't too clear about what I want to do.
    In a nutshell, I have a form embedded in a PopUp layer on my "contact.htm" page. That PopUp is named PopUp-1 and it works fine. I'm thinking that PopUp-1 is stored as an object and should be reusable. I should be able to link to it from anyplace on the "index.htm" page (or any other htm page) without a lot of programming.
    Isn't it just as simple as I think?
    Paul
    Paul, it is not as simple as you imagine.

    The name of Layers are not part of the published website.
    A layer is a container of content that may be used in a pop-up or just to establish a hierarchy of objects.

    The pop-up can be triggered if you know a thing in that layer.
    We do this by Naming something and then finding it and moving up to its Grandparent.

    To trigger this from another page actually requires you to jump to the holding page and then trigger it.
    I do not think you are after this.
    I have coded this before and is it fairly simple to implement.

    Instead, I suggest you create your form on a separate design page and crop the page down to fit.
    You then need to use the Embed a website widget in a pop-up layer on every page.
    You then have a nornal button on each page to open the pop-up (and form).

    Acorn
    Acorn - installed and active Xara software: Cloud+/Pro+, XDPX, XWD Premium 15 & 12, XPGD10, X3D7, Xara Xtreme 5, back through time (to CC's Artworks).
    Raise software faults with MagiXara: http://support.magix.net/; if Cloud+/Pro+: https://xara.com/contact-us/

 

 

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
  •