Coder Social home page Coder Social logo

angular-slider's Introduction

angular-slider Build Status

Slider directive for AngularJS. Based on: http://github.com/prajwalkman/angular-slider with some enhancements

Features

  • Single or dual knob
  • Fully Stylable
  • Adjustable knob "Stickiness"
  • Adjustable minimum range width
  • Draggable range
  • Touch and IE10+/Win8 pointer event support

Known Issues

  • Doesn't work in IE8-

Usage

Requirements

<script src="lib/modernizr.custom.72715.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular-touch.min.js"></script>
<script src="build/angular-slider.min.js"></script>

Single Knob

Markup

As an element:

<slider
	ng-model="{string}"
	floor="{float}"
	ceiling="{float}"
	step="{float}"
	precision="{integer}"
	stretch="{integer}"
	translate="{string}">
</slider>

As an attribute:

<div
	slider
	ng-model="{string}"
	floor="{float}"
	ceiling="{float}"
	step="{float}"
	precision="{integer}"
	stretch="{integer}"
	translate="{string}">
</div>

Parameters

Param Type Details
ng-model string Assignable angular expression to which to data-bind the value.
floor float The lowest value possible
ceiling float The highest value possible
step float (optional) The width between each tick. Default: infinite
precision integer (optional) The numerical precision to which to round the value. Default: 0
stretch integer (optional) How stretch resistant the knobs will act. The higher the stretch resistance the more "snappy" the knobs will feel. Default: 3
translate string (optional) A translation function to apply to all view values. Be sure to omit the parentheses (e.g. "transFunc" instead of "transFunc()")
--

Dual Knob

Markup

As an element:

<slider
	ng-model-low="{string}"
	ng-model-high="{string}"
	floor="{float}"
	ceiling="{float}"
	step="{float}"
	precision="{integer}"
	stretch="{integer}"
	translate="{string}">
</slider>

As an attribute:

<div
	slider
	ng-model-low="{string}"
	ng-model-high="{string}"
	floor="{float}"
	ceiling="{float}"
	step="{float}"
	buffer="{float}"
	precision="{integer}"
	stretch="{integer}"
	translate="{string}">
</div>

Parameters

Param Type Details
ng-model-low string Assignable angular expression to which to data-bind the low value.
ng-model-high string Assignable angular expression to which to data-bind the high value.
floor float The lowest value possible
ceiling float The highest value possible
step float (optional) The width between each tick. Default: infinite
buffer float (optional) The minimum difference between the low and high values. Default: 0
precision integer (optional) The numerical precision to which to round the value. Default: 0
stretch integer (optional) How stretch resistant the knobs will act. The higher the stretch resistance the more "snappy" the knobs will feel. Default: 3
translate string (optional) A translation function to apply to all view values. Be sure to omit the parentheses (e.g. "transFunc" instead of "transFunc()")

angular-slider's People

Contributors

drgould avatar jlinn avatar

Watchers

 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.