Smooth Single Page Transition Effects Using jQuery And CSS3 - page.js

Smooth Single Page Transition Effects Using jQuery And CSS3 - page.js

page.js is a jQuery plugin used to implement the smooth CSS3 based page transition effects on your one page website and single page web application. The plugin enables you to switch between pages with slide or flip animations using CSS3 transitions, transforms and perspectives.

How to use it:

1. Load jQuery library and the jQuery page.js plugin's JavaScript & CSS files in the document.

<script src="jquery.min.js"></script>
<link href="" rel="stylesheet">
<script src=""></script>

2. Add unique IDs to your page slides using data-jquery-page-name attribute as follows:

<div class="page" data-jquery-page-name="1">
<div class="page" data-jquery-page-name="2">
<div class="page" data-jquery-page-name="3">

3. Create navigation buttons to transition between these page slides. You're allowed to specify the animation types and directions using data-page-trans attribute like this:

<div class="navigate" data-page-name="1" data-page-trans="slide-in-from-right">slide-in-from-right</div>
<div class="navigate" data-page-name="2" data-page-trans="slide-in-from-bottom">slide-in-from-bottom</div>
<div class="navigate" data-page-name="1" data-page-trans="slide-in-from-left">slide-in-from-left</div>
<div class="navigate" data-page-name="2" data-page-trans="slide-in-from-top">slide-in-from-top</div>
<div class="navigate" data-page-name="1" data-page-trans="flip-towards-right">flip-towards-right</div>
<div class="navigate" data-page-name="2" data-page-trans="flip-towards-left">flip-towards-left</div>

4. Call the function on the top container to initialize the plugin.


5. Active the navigation buttons.

$(".wrapper .page .navigate").click(function (ev) {
  var page  = $("data-page-name");
  var trans = $("data-page-trans");
  if ($(".wrapper").page().fetch(page) === null)
      $(".wrapper").page().transition(page, trans);

6. Remove a specified page slide from your website.


7. Shake the current page slide.


Change log:


This awesome jQuery plugin is developed by rse. For more Advanced Usages, please check the demo page or visit the official website.

  • Publication date: 12.05.2018
  • Source