Animated page transitions
Page transition class provides a way to define animated transitions between switching webpages. Definition of transition consists of defining 3 types of parameter values: for default page, for transitions start before going to other link and for transitions end, when new page was loaded.
There are also 24 predefined transitions included in package for you to test it out and use as examples for creating your own transitions.
- when animation starts
- when webpage is about to change to other
- when webpage changed to other
- when animation ends
It is possible to provide which links can use which transitions in a similar as jQuery like selector way. And transition can be also called programmatically using classes API.
Contents
- Download
- Example codes
- Examples in action
- Video demonstration
- Animation properties
- Method list
- Latest changes
Download
Example codes
Examples in action
Video demonstration
Animation properties
Properties that can be animated to create transitions:
- opacity (default value to use: 1)
- top (default value to use: 0)
- left (default value to use: 0)
- width (default value to use: "auto")
- height (default value to use: "auto")
- scaleX (default value to use: 1)
- scaleY (default value to use: 1)
- skewX (default value to use: 0)
- skewY (default value to use: 0)
- rotate (default value to use: 0)
Method list
Constructor
| Method name | new page_transition(selector, config); |
| Description | Provides defined transition style for links that match selector |
| Input parameters | string selector - selectof for document.querySelectorAll function (a jQuery like selector) json config - Json structure with configuration properties
|
| Example input | var pt = new page_transition(selector, {
transitionDefault: {
rotate: 0,
top: 0,
left: 0
},
transitionBegin: {
rotate: 360,
top: -2000,
left: 2000
},
transitionEnd: {
rotate: 360,
top: -2000,
left: 2000
}
}); |
Start animation programmatically
| Method name | animate(from, to, url) |
| Description | Start transition animation, usually it is done by clicking on a links provided as selector for page_transition object. But it is also possible to call animations programmatically. |
| Input parameters | object from - object with current animation values object to - object with target animation values string url - url where to redirect, after animation (optional) |
| Example input | var pt.animate(
{
rotate: 0,
top: 0,
left: 0
},
{
rotate: 360,
top: -2000,
left: 2000
},
"./test2.html"
); |
End animation
| Method name | end() |
| Description | End transition animation after loading a page. Basically this should be called right after creating new page_transition (except when you have multiple transitions defined, you need to call end method for specific transition that occured) |
Latest changes
None for now
You may also be interested in:
Powered by BlogAlike.com










