Git Product home page Git Product logo

angular-sticky's Introduction

angular-sticky

AngularJS directive to cause elements to stick to the top of the page when scrolling past

Requires jQuery 1.2.6+.

A simple directive enables sticky functionality to be added to elements, causing them to stick to the top of the screen as they are scrolled past.

Quick implementation and only tested on latest Chrome and Firefox, so use at your peril...

Features

  • Allows use of a placeholder to stop the page jumping
  • Recalculates element position on page load and on window resize
  • Handles multiple sticky elements efficiently

Usage

Include the .js and .css file in your page then enable usage of the directive by including the "sticky" module as a dependency. Use the directive as follows:

<div sticky>I'm all sticky</div>

To stop the page jumping when the element is fixed to the top of the screen a placeholder can be substituted for it as follows:

<div sticky use-placeholder>I'm all sticky</div>

See the example directory for a working example.

angular-sticky's People

Watchers

 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.