open iFrame from text box

Q&A about the latest versions
Post Reply
M360
Posts: 3
Joined: Fri Jul 16, 2021 9:20 am

I am trying to open a web page in an iframe, but only if the user clicks on a certain word in the text. Now I have word linked to the webpage but it opens in another window. I've already built a block for iframe to open in, but I don't know how to "call" the block if the user clicks on a certain word in the text.

Thank you for your help!

With best regards,
Blaz
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi Blaz,
Please see the attached project.
You will see a text box with two links, these open in an iframe.
The text box also hides when the iframe is open.

How it works:
The skin as a text variable, var_url.

The text box has an href link that sets a URL to the text variable using javascript.

Code: Select all

<a href= "javascript:pano.setVariableValue('var_url', varValue ='https://en.wikipedia.org/wiki/Car')">Click Here</a>

The text box then has a Variable Changed action that sets the iframe to the text box that shows the iframe.

The action:
Source: Variable Changed
Variable: var_url
Action: Set Value
Value: <iframe src="$(*var_url)" width="100%" height="100%" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" frameborder= "0"></iframe>
Target: web_page


The iframe src uses a variable placeholder $(*var_url) so it uses the URL set by the href text link to the variable, var_url.

The close button clears the variable and removes the iframe from the text box ready for the next link.

The example uses two text links that set two different URLs, this way you can have as many text links as you want in a text box.
You can also have as many text boxes as you want, but only one needs the Variable Changed action.
Regards,
Attachments
textLink.zip
(14.81 KiB) Downloaded 169 times
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
signmaster
Posts: 2
Joined: Mon May 19, 2014 12:41 pm

Very useful, thanks for the info Martin.
How would you do this with an icon?
That is click on an icon and open the iframe.

Steve
M360
Posts: 3
Joined: Fri Jul 16, 2021 9:20 am

Thank you for your quick help. That is exactly what I need! :D

Best,
Blaz
RAlarcon
Posts: 33
Joined: Sun Sep 06, 2015 10:47 pm
Location: Liverpool, England.
Contact:

Hi Everyone,

I have managed to insert an Iframe in the pages of an Flipbook, which pages are made out of the equrectangle of a panorama; alas as you go along it is showing panoramas that do not relate to the image displayed on the pages. though the href is correct, Is it to do with "on click open comand ", do I need an "on click close comand ", I was wondering if any body with knowledge of java script could please help me.

Here is the link to the flipbook please feel free to peruse http://360panoview.co.uk/chilemagazine/ ... azine.html

kind regards,

Rodrigo
RAlarcon
Posts: 33
Joined: Sun Sep 06, 2015 10:47 pm
Location: Liverpool, England.
Contact:

Hi Hopki, is there a link with the implemented code, to look at ? Sorry the attached files seem to be for aMac I'm on windows.


regards,

Rodrigo
RAlarcon
Posts: 33
Joined: Sun Sep 06, 2015 10:47 pm
Location: Liverpool, England.
Contact:

Sorry Forgot to include the code I am using to open the iframe, here it is.

<html>
<head><meta charset="utf-8">
<title>Santiago de Chile</title>
</head>

<body>
<img src="pages/link/07.jpg" usemap="#workmap" width="520" height="624">

<map name="workmap">
<area shape="circle" coords="270,80,70" onclick="myFunction()">

<script>
var myWindow;
function openWin() {
window.open(href="panos/santiago/index.html", "_blank", "toolbar=no,scrollbars=no,resizable=yes,top=250,left=350,width=1200,height=600");
}

function closeWin() {
myWindow.close();
}
</script>

</body>
</html>
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi Rodrigo,
The download can be opened using your windows computer, Pano2VR can open the project regardless of OS.
Regards,
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
lavAzza
Posts: 19
Joined: Mon Dec 07, 2020 3:25 pm

signmaster wrote: Sat Jul 17, 2021 6:51 am Very useful, thanks for the info Martin.
How would you do this with an icon?
That is click on an icon and open the iframe.

Steve
Hi.
Did you solve this problem?
User avatar
Hopki
Gnome
Posts: 13005
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi,
Please find two projects attached.
If you only want to open from an icon/button then see project textLink3.zip.

The icon changes a variable to show and hide the text box, but this could also just be a hide and show action, so no variable is required.
The next action is to set the iframe to the text box that will display the iframe.

The project textLink2 uses the same concept as using the text links but uses an icon/button as well.
Only use if you intend to use both text links and buttons.
Regards,
Hopki
Attachments
textLink2.zip
(17.76 KiB) Downloaded 74 times
textLink3.zip
(16.26 KiB) Downloaded 77 times
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
markb
Posts: 3
Joined: Mon Jan 31, 2011 8:13 am

Hello @hopki


will this work in version 6 - no cash to upgrade yet

I've just tired to copy the variable parameters but var-_url not showing up in pano2vr6.

I could really do with getting this to work


kind regards

mark
markb
Posts: 3
Joined: Mon Jan 31, 2011 8:13 am

ignore this i think i have it working
Post Reply