Skip to content
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

Transition by percentage ? #219

Open
daslicht opened this issue Jan 15, 2015 · 2 comments
Open

Transition by percentage ? #219

daslicht opened this issue Jan 15, 2015 · 2 comments

Comments

@daslicht
Copy link

Hi,
is it possible to use percentage instead of pixels ?
I tried something like this , but that did not work:

$(".box").transition({ left: 20% });
//or
$(".box").transition({ left: '20%' });

The latter moves the object but without animation?

@victorluissantos
Copy link

hi, try this cody
$( ".box" ).animate({ "left": "+=20%" }, "slow" );

@tezma90
Copy link

tezma90 commented Feb 13, 2015

you can use variables instead

var temp=your*width; //window.innerWidth

$(".box").transition({ left: temp/5 });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants