A common question that I am struggling to make work -
Task:
Keyboard actions served to different pieces of my page
- index.html using "<body onkeydown="onkeydown_resp()">"
- onkeydown_resp() is in utils.js
- page is hosting an iframe with projects.html
- uses keyboard to stop/start some media
Need:
JavaScript state changes shared across Js & HTML content
e.g. onkeydown_resp() may -
Trigger the loaded iframe of projects.html to toggle to a new project (Key1)
Stop an animation for one of those project demos (Key2)
And toggle some audio (Key3)
I have tried a plethora of options to no success. I am just looking to learn & establish a portfolio demo for www.justinreina.com.
Question:
- How can I get this task to work?
Expected - create a global 'var' or window.myVar and share it