But for the next step - adding jQuery code - here I need a help of js-savvy Hype users!
That jQuery code snippet from the Codepen demo makes it possible to
show/hide the info box that follows / floats over the cursor.
Look up
I am a js novice, so
I simply copy-pasted this jQuery code snippet into the Head Html.
But that obviously didn’t do the trick.
Do I need to tweak this jQuery code or smth else?
The code here places the name of the state within an element with the ID ‘info-box’ so if you add an element to your Hype scene with that Unique Element ID, it will follow your mouse and place the info inside of it when you move your mouse over a state. I added an info-box rectangle outside of the scene area that you can use for this:
I was trying to modify the “pathcontrol” script so that rather than showing specific data in the info-box, it actually shows / hides another element specific only to that state. Problem is, using the line below to call up a specific state is not working. Any ideas?
Just looking from the one line you sent, I imagine you may just need a dot instead of space between path and id:
selected = path.id;
If that isn’t it, you may want to attach your current modified version since that line/functionality isn’t in the original so we don’t know where it is going wrong.