-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to not repositionning elements? #20
Comments
Hi, I faced this problem too, with a little bit more personalization I came up with this SineWave function: var SineWave = function($el) {
this.offsety = $el.offset().top;
this.offsetx = $el.offset().left;
this.direction = -1; //-1 for left to right, 1 for right to left
this.amplitude = 300;
this.frequency = 10;
this.css = function(p) {
var s = Math.sin(p*20);
var x = this.direction * p * this.amplitude + this.offsetx;
var y = s * this.frequency + this.offsety;
return {top: y + "px", left: x + "px"};
}
};
$("#element").animate({path : new SineWave($("#element"))},5000, "linear"); I hope this helps. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would like to move items from their position I defined in relative and not in a redefined position. Is there a way to do that? I'll be grateful if you could help me :-)
The text was updated successfully, but these errors were encountered: