Coder Social home page Coder Social logo

zurvu-jquery-peek's Introduction

jQuery.Peek

jQuery Peek is a great way to keep your navigation while preserving your precious screen real estate for your content. While the user is viewing the page, the navigation is tucked away. When the user scrolls up (or down), the navigation will reappear.

Note: This is a fork of the original repository that was originally forked to allow support for negative indices.

The major maintainer is: @mcollis.

Getting Started

Download the production version or the development version.

In your web page:

<script src="jquery.js"></script>
<script src="dist/jquery.peek.min.js"></script>
<script>
jQuery(function($) {
  $('.top-nav').peek();
});
</script>

Documentation

jQuery Peek is pretty straight forward as far as usage goes.

$(targetElement).peek(options);

Options

showDirection (Default: "up") - What direction should the user be scrolling when the element is showing.

toggleClass (Default: "hidden") - Class used to hide the element.

triggerDelta (Default: 50) - After a user has scrolled more than this many pixels show or hide the target element.

triggerElement (Default: window) - Element to bind the scroll event to.

Examples

Checkout the index.html for working examples.

Zurb Foundation's top navigation bar by default isn't in a fixed position but can be easily done with a couple lines of CSS.

body {
  padding-top: 60px;
}

.top-bar {
  position: fixed;
  width: 100%;
  z-index: 10;
  top: 0;
  transition: top 0.2s ease-in-out;
}

.top-bar.hidden {
  top: -45px;
}

And then add the following JS code:

$('.top-nav').peek();

Bootstrap's top navigation works with Peek out of the box. Simply add the following JS call:

$('.navbar').peek();

Release History

0.1.0

Initial Release

zurvu-jquery-peek's People

Contributors

nrdobie avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.