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.
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.
Re: Call Javascript Function from Link Properties.
Quote:
Originally Posted by
gwpriester
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?
Re: Call Javascript Function from Link Properties.
Quote:
Originally Posted by
BobJohnson
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
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
Re: Call Javascript Function from Link Properties.
Quote:
Originally Posted by
BobJohnson
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