Coder Social home page Coder Social logo

skrollr-pages's Introduction

skrollr-pages

Adds a concept of "pages" to skrollr. Pages are sub-intervals of the page you are scrolling which are endowed with special page-like behaviour, including "scrollspy" and local navigation. This is a bit tedious to do direclty with skrollr. Specifically:

  • Pages should be dom elements with a (default is "page"). The pags should have a unique ID if you want in-page navigation to work.
  • Local navigation will be updated to reflect which "page" you scroll to.
  • Pagination elements will automatically be wired up to scroll through pages if you create them. Default classes for these are "scroll-page-down", "scroll-page-up", "scroll-page-top", "scroll-page-bottom".

Example:

My company, Countable uses this skrollr add-on.

Usage:

<!-- currently requires jQuery. -->
<script src="jquery-1.9.1.min.js"></script>
<script src="skrollr.min.js"></script>
<script src="skrollr-pages.js"></script>

<script>
  $(function(){
    skrollr_instance = skrollrPages()
  });
</script>

<ul>
  <li><a href="#page1">page 1</li>
  <li><a href="#page2">page 2</li>
</ul>

<div class="page" id="page1">
   first page content.
</div>
<div class="page" id="page2">
   2nd page content.
</div>

<style>
  .page {height: 1000px;}
  .active {color: red;}
</style>

skrollr-pages's People

Contributors

countable avatar

Watchers

 avatar  avatar

Forkers

kailinhaley

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.