jamestagal / edtechdesigner

A professional blog site of Benjamin Waller
https://edtechdesigner.io
0 stars 1 forks source link

Get the h5p resizer.js working #2

Closed jimafisk closed 2 years ago

jimafisk commented 2 years ago

H5P conveniently provides an iframe resizer which is a javascript helper file that is added to my hosted account. So I have created a h5p.svelte file in the scripts folder but I don't have enough knowledge of how to import or get it into the post.svelte file for it to work and resize the iframe properly. See h5p.svelte file below

<script
src="https://edtechdesigner.h5p.com/js/h5p-resizer.js" charset="UTF-8">
</script>

See screenshot of the embedded iframe not resized.

svelte

If you could help me get this working I would really appreciate it.

jimafisk commented 2 years ago

Moving this script into the <head> of the project should solve this. See https://github.com/jamestagal/edtechdesigner/pull/8

See screenshot ![iframe](https://user-images.githubusercontent.com/5913244/147597997-71234bc9-e62e-4d40-a9c6-a93118ff1b4d.png)
jamestagal commented 2 years ago

Hi Jim. thank you. I have added it as you suggested and all is good. 👍

<head>
  <script
 src="https://edtechdesigner.h5p.com/js/h5p-resizer.js" charset="UTF-8">
  </script>
</head>