Forum Discussion
Course in full screen?
Hi Michael.
I know this is an old thread but thought maybe someone else might need this as well.
First of all, thank you for the code. But one point.
I put the code at the beginning of my timeline to go to full screen right away. But since your function is not inside a $(document).ready of jQuery, the function will be executed before even loading the jQuery library, therefore giving an error of "$ is not defined".
Besides, as almost all your code is just pure JavaScript, there is no need to use jQuery just to select a dom object.
So, what I did was to replace "$("#preso").get(0)
" with "document.getElementById('preso')
" and totally removed loading jQuery:
if (document.getElementById('jquery') == null) {
add_script("https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js", "jquery");}
Now, it works perfectly.