Skip to content

Instantly share code, notes, and snippets.

@ashnur
Created March 19, 2012 20:37
Show Gist options
  • Save ashnur/2126897 to your computer and use it in GitHub Desktop.
Save ashnur/2126897 to your computer and use it in GitHub Desktop.
"use strict";
var z,y,i;
var i =-100;
function Obiekt(z,y,t,iddiv) {
var self = this;
self.ruch = function() {
++i;
$(iddiv).css('left', ($("#punkt").position().left)+i);//I want send var. indiv in place on orbita1
$(iddiv).css('top', ($("#punkt").position().top) + (Math.round(Math.sqrt((1-Math.pow(i,2)/Math.pow(z,2))*Math.pow(y,2)))));//I want send var. indiv in place on orbita1
}
self.start = function() {
setInterval( self.ruch , 300 ); /* Why not {setInterval('self.ruch',300) */
}
}
var pierwszyObiekt = new Obiekt(100,100,4,'#orbita1');
pierwszyObiekt.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment