Welcome to TalkGraphics.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2003
    Location
    Reading, United Kingdom
    Posts
    168

    Default Call Javascript Function from Link Properties.

    I have some graphics that act as buttons, making a popup layer visible through the Link Properties dialogue. I need to call a function in the head at the same time as showing the popup and cannot work out how to do this. If it is not possible and I have to use a placeholder, then does anyone now how to show the popup from my function?

    Thanks in advance.

  2. #2
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,487

    Default Re: Call Javascript Function from Link Properties.

    The forums have gone moribund.

    Please give us a description of exactly what it is you want to happen and how and let us see if we can figure a way to make it work.

  3. #3
    Join Date
    Nov 2010
    Posts
    6

    Default Re: Call Javascript Function from Link Properties.

    Quote Originally Posted by gwpriester View Post
    The forums have gone moribund.

    Please give us a description of exactly what it is you want to happen and how and let us see if we can figure a way to make it work.
    I know this is an old posting but I have similar problem.
    I want to open a pop up layer and play an mp3 sound as the layer opens or preferably when I click a button on the layer with a ‘popup:close’ link.
    An alternative would be to use a JavaScript function to play the sound then somehow automatically close the Popup layer. Can ‘Popup:close’ be initiated with JavaScript?

  4. #4
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,747

    Default Re: Call Javascript Function from Link Properties.

    Quote Originally Posted by BobJohnson View Post
    I know this is an old posting but I have similar problem.
    I want to open a pop up layer and play an mp3 sound as the layer opens or preferably when I click a button on the layer with a ‘popup:close’ link.
    An alternative would be to use a JavaScript function to play the sound then somehow automatically close the Popup layer. Can ‘Popup:close’ be initiated with JavaScript?
    Bob, the answer is yes.

    Render your page, open the pop-up and hover over the Close shape.
    In the browser status bar, you will see code similar to javascript:xr_ppc("xr_xp5");. You can replace the 'popup: close' statement with this.
    The '5' is the count of layer up from the bottom.

    To add in a play call you would need to add an ID to the <audio> tag, say, id="myTune".
    you can then add to the button JS above something like:
    javascript:xr_ppc("xr_xp5"); document.getElementById("myTune").play();

    If you wanted to play on opening the pop-up, it would be
    javascript:xr_cpu(5); document.getElementById("myTune").play();
    I got the xr_cpu() detail by hovering over the open button, the same way as above.

    The audio control does not have to be on the pop-up layer. You can place it anywhere so it can be played at any time or even hidden. It just needs to rendered into the DOM.

    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

  5. #5
    Join Date
    Nov 2010
    Posts
    6

    Default Re: Call Javascript Function from Link Properties.

    Acorn - You're a star. Works a treat
    Many thanks - this has had me baffled for days.
    Your time explaining and providing code is much appreciated.
    Just a thought - is there a reference link anywhere to show other function calls like 'xr_ppc' and 'xr_cpu'?
    Again many thanks
    Bob

  6. #6
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,747

    Default Re: Call Javascript Function from Link Properties.

    Quote Originally Posted by BobJohnson View Post
    Acorn - You're a star. Works a treat
    Many thanks - this has had me baffled for days.
    Your time explaining and providing code is much appreciated.
    Just a thought - is there a reference link anywhere to show other function calls like 'xr_ppc' and 'xr_cpu'?
    Again many thanks
    Bob
    Bob, these many functions and the nuts and bolts of the application. They sit in roe.js but are mainly squirrely so I would not recommend you going there.

    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

 

 

Tags for this Thread

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
  •