Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript that act like css3 transition

I want to do something like -moz-transition effect that give me a animated rotate picture. or move a picture from bottom of it's wrapper to top of it.

for clarify how I want just take a look at This Link and see the four pictures that are under slider.

It uses -moz-transition CSS3 effect but I want to have something with js or jQuery to animate it even in IE.

Is there any plugin for it?

Thanks alot

like image 388
Mosijava Avatar asked Jul 10 '12 10:07

Mosijava


People also ask

How do you do a transition effect in JavaScript?

The solution is actually quite simple using JavaScript. To trigger an element's transition, toggle a class name on that element that triggers it. To pause an element's transition, use getComputedStyle and getPropertyValue at the point in the transition you want to pause it.

What is transition in JS?

Definition and Usage. The transition property is a shorthand property for the four transition properties: transitionProperty, transitionDuration, transitionTimingFunction, and transitionDelay. Note: Always specify the transitionDuration property, otherwise the duration is 0, and the transition will have no effect.

What is CSS3 transition?

CSS transitions provide a way to control animation speed when changing CSS properties. Instead of having property changes take effect immediately, you can cause the changes in a property to take place over a period of time.

How do you trigger transition CSS?

Triggering transitions You can trigger CSS transitions directly with pseudo classes like :hover (activates when the mouse goes over an element), :focus (activates when a user tabs onto an element, or when a user clicks into an input element), or :active (activates when user clicks on the element).


2 Answers

jQuery's .animate() will do this in a cross-browser way.

$( '.button' ).animate( { top: '-=50' }, 400 );
like image 91
ThinkingStiff Avatar answered Oct 18 '22 09:10

ThinkingStiff


This tutorial seems to perfectly fit to your needs.

like image 36
Thariama Avatar answered Oct 18 '22 10:10

Thariama