Skip to content

aerojs/aero-ajax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aero-ajax

Lightweight ajaxification plugin for Aero using high-performance CSS transitions.

Installation

Add aero-ajax to dependencies in your package.json:

"dependencies": {
	"aero-ajax": "*"
}

Preparation

You need to define your main element with the ID content in your layout template:

main#content!= content

However this plugin requires user-defined CSS transitions for enhanced performance and flexibility. Therefore you also need to add a fade class:

main#content.fade!= content

Then define which animation you want for page swaps. Add fade.styl in styles:

.fade
	opacity 1
	will-change opacity
	transition opacity 200ms ease

.fade-out
	opacity 0

Usage

Let's say you have a link on your page:

a(href='/contact') Contact

Simply add the ajax class to make it load the page via AJAX requests:

a.ajax(href='/contact') Contact

About

🍰 Interprets 'ajax' class for hyperlinks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published