JavaScript not executing (code is working though)

Hello, I am experiencing following problem:

I have enabled volume control (Modern Player, SL360) on my project. Since I don't want the volume control to show up on every slide I am using following JS code to hide it:

$("#volume").style.display = "none";

Whenever I execute the code over the console it seems to work, the volume control disappears. However when using the "Execute JavaScript" Trigger (when the timeline starts on this slide, after publishing) it's not doing anything. Putting the trigger on a button is not working neither. Does anyone has a solution for this problem?

Thanks in advance!

2 Replies
Dave Cox

Hi Maximillian

The code that you put above is Jquery, which is requires the Jquery library. By default, Storyline no longer includes the Jquery library, so you would either need to install it yourself.

A better method is to just you pure JavaScript. Here is the pure JavaScript code to accomplish the same thing:

document.getElementById("volume").style.display = "none";

I tested this, and it works just fine for me.

Regards,
Dave