]> _ Git - Animations.git/commitdiff
Add example embed.html file. WIP #4614 @0:05
authorStephen Cameron <stephen@cubedesigners.com>
Wed, 28 Jul 2021 13:09:58 +0000 (15:09 +0200)
committerStephen Cameron <stephen@cubedesigners.com>
Wed, 28 Jul 2021 13:09:58 +0000 (15:09 +0200)
YSL-satisfaction-survey/embed.html [new file with mode: 0644]

diff --git a/YSL-satisfaction-survey/embed.html b/YSL-satisfaction-survey/embed.html
new file mode 100644 (file)
index 0000000..45a446e
--- /dev/null
@@ -0,0 +1,37 @@
+<!doctype html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport"
+          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
+    <meta http-equiv="X-UA-Compatible" content="ie=edge">
+    <title>Embed Test</title>
+    <style>
+        html, body {
+            height: 100%;
+        }
+        body {
+            margin: 0;
+            padding: 1em;
+        }
+    </style>
+</head>
+<body>
+<b>Embed Test</b>
+<button onclick="document.getElementById('iframe').contentWindow.fluidbook.links.triggerLinkById('survey')">Open Popup</button>
+<br><br>
+<iframe id="iframe" width="100%" height="90%" frameborder="0" marginheight="0" marginwidth="0" allowfullscreen="true" src="index.html"></iframe>
+<script>
+var iframe=document.getElementById('iframe');
+iframe.addEventListener( "load", function(e) {
+       var $=iframe.contentWindow.$;
+       $(function(){
+               var fluidbook=document.getElementById('iframe').contentWindow.fluidbook;
+               $(fluidbook).on('fluidbook.help.show',function(){alert('help is displayed')});
+               $(fluidbook).on('fluidbook.help.hide',function(){alert('help is hidden')});
+       });
+});
+
+</script>
+</body>
+</html>