Forum Discussion
Removing objects if I watch my project on a different device
Hello ahmad,
Storyline automatically adds in identifiers (classes) depending on the device and orientation.
I wrote some javascript to check for these identifiers (classes).
The javascript updates true/false variables: isDesktop, isPhone, isTablet, isLandscape, isPortrait
Depending on these variables, you can add a trigger to change the state of 'an icon' to hidden or normal.
Here is the javascript that I use:
var player = GetPlayer();
player.SetVar('isDesktop', document.body.classList.contains('view-desktop'));
player.SetVar('isPhone', document.body.classList.contains('view-phone'));
player.SetVar('isTablet', document.body.classList.contains('view-tablet'));
player.SetVar('isLandscape', document.body.classList.contains('is-landscape'));
player.SetVar('isPortrait', document.body.classList.contains('is-portrait'));
- ahmadhabhab5 years agoCommunity Member
Hello Russell,
Thanks for your reply
so now i just post your java script on my project
and i'll create a variable x (True/False) default true
then ill adjust variable x to be true, when the timeline starts ( do i have to put a condition ?)
finally i change state an icon to be hidden if this variable is false ( for example, the false scenario is that the user is using a mobile or ipad )
Thanks again for your help...
Regards,
Related Content
- 10 months ago
- 5 months ago