Giter Club home page Giter Club logo

ng-sticky-element's Introduction

ng-sticky-element Build Status

Angular directive to make HTML elements sticky when scrolling.

Demo

Usage

Install via Bower or NPM:

bower install ng-sticky-element --production
# or
npm install ng-sticky-element --production

Include main files:

<link rel="stylesheet" href="bower_components/ng-sticky-element/dist/ng-sticky-element.min.css">
<script src="bower_components/ng-sticky-element/dist/ng-sticky-element.min.js"></script>

Include afklStickyElement module as a dependency into your app:

angular
  .module('yourApp', [
    'afklStickyElement'
  ]);

Place afkl-sticky-element attribute onto element:

<div afkl-sticky-element>I am now sticky.</div>
<!-- with optional attributes:
  afkl-sticky-element="bottom"
  afkl-sticky-element-offset="24" // offset in px
  afkl-sticky-element-mq="(min-width: 640px)" // applies stickiness only if given media-query is true
-->

Browser Support

All modern browsers & IE versions newer than 9 are supported. IE9 should also be fine in case you polyfill matchMedia.

Development

  1. Clone the repo or download.
  2. npm install && bower install
  3. Setup E2E testing environment: npm install -g protractor && webdriver-manager update --standalone
  4. Make the selenium driver up: webdriver-manager start --standalone and run gulp build
  5. Run gulp watch, navigate to http://localhost:8080/demo/index.html and play on /src
  6. Make sure that tests are up and green: gulp test-unit or gulp test-e2e

License

MIT

ng-sticky-element's People

Contributors

tameraydin avatar mvdkleijn avatar

Watchers

James Cloos avatar FullSprintDev 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.