I'm trying to adapt this script on CodePen to work with the body
tag instead of the container
id.
I've modified this line:
TweenLite.set("#container",{perspective:600})
With this line:
TweenLite.set("body",{perspective:600})
This change seems to work, adding a "perspective:600;
" to the body
tag.
Then I replaced this line:
var container = document.getElementById("container"), w = window.innerWidth , h = window.innerHeight;
With this line:
var container = document.getElementsByTagName("body"), w = window.innerWidth , h = window.innerHeight;
I've checked SO and Google and while it seems that getElementsByTagName
instead of getElementById
is the correct way to do it, for some reason it isn't working.
How can I correctly apply the change from id to tag in order for the script to work?
Here's a JSFiddle for you to play with.