Hi, Kenton -- Thanks for stopping in to share your suggestion! As we are not able to provide support for JavaScript, it's always great to see community members assisting one another with JS! And for anyone who may be interested in taking a look, here is our JS Best Practices sheet, as well.
8 Replies
Javascript doesn't work in the AMP so if it doesn't work then likely it will be in the AMP
Thanks Phil. Would be nice to branch : IF AMP then display AMP pinch, swipe instructions
Run some javascript to change a variable (T/F) to True if it stays false show your layer with iPad instructions
The code the test if the course is running in AMP is what's foxing me.
If Javascript does not run in AMP, then how is the test done?
If you have a variable that is initially false, but is set by javascript to true on timeline start of the first slide.
If that variable is not changed to true then it must be in the AMP as javascript only does not work in the AMP.
I would then show a layer with the iPad instructions if the variable is equal to false and PC instructions if true
Hope that explains my reasoning
I like that idea Phil.
Does anyone have a javascript example that they could share that could perform such a function? ie set a variable to true to detect AMP use.
Hey Dazzer,
A little late to the party, but you'll want to try something like this:
First, have a variable to check if it's an iPad or not. I'll just call my variable "iPad". Set it to true.
Then, execute JavaScript when the timeline starts. Run a script like this:
var player = GetPlayer();
player.SetVar("iPad", false);
That sets your variable to false, which means JavaScript must be working, and thus not inside the Articulate Mobile Player.
Then below, let's say you're clicking a button, do something like:
Jump to Slide X if "iPad" is equal to false (so, NOT in the AMP)
Jump to Slide Y if "iPad" is equal to true (so, in the AMP)
You'll probably not see this as the last comment on this thread was over a year ago, but maybe it will help somebody else down the road.
Hi, Kenton -- Thanks for stopping in to share your suggestion! As we are not able to provide support for JavaScript, it's always great to see community members assisting one another with JS! And for anyone who may be interested in taking a look, here is our JS Best Practices sheet, as well.
This discussion is closed. You can start a new discussion or contact Articulate Support.