I am currently using the gravity script found here to create a gravity effect on my web page im developing locally atm.
My problem is that the activation of the gravity effect seems to be on mouse-movement whereas I need it to just fire when the document is ready. The google.code page requires that you simply link to the gravityscript.js file in the head or body and once loaded the gravity effect fires as soon as the mouse moves over the webpage I assume <body> tag.
An example of this effect can be seen here.
The uploader of the script did supply this piece of code (below) that is supposed to activate the gravity effect on click, but all it seems to do is load the file on click then you still have to move the mouse after the click to activate the gravity effect. How can I make this effect truly automatic on page load?
$('body').click(function() {
var script = document.createElement("script");
script.src="http://gravityscript.googlecode.com/svn/trunk/gravityscript.js";
document.body.appendChild(script);void(0);
});
The actual gravityScript script can be seen here I had a look at it to see what actually fires the script but to no avail.
I added another script to do this. Just use this new script.
http://gravityscript.googlecode.com/svn/trunk/gravityscript-autorun.js
Also, GravityScript was not made by Mr. Doob.
He made Google Gravity which is the base for GravityScript.