# angular-panhandler

> Pan to scroll DOM elements

Latest version **1.1.2** (published 2016-08-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install angular-panhandler
pnpm add angular-panhandler
yarn add angular-panhandler
bun add angular-panhandler
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2016-08-18 |
| First published | 2016-08-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Nathan Bleigh |
| Maintainers | stackdot |
| Keywords | angular, scroll, pan, draggable |

## Links

- npm: https://www.npmjs.com/package/angular-panhandler
- npm.io page: https://npm.io/package/angular-panhandler

## Recent versions

- 1.1.2 (latest) — 2016-08-18

## README

![panhandler](http://nnnnathann.github.io/angular-panhandler/images/brand.jpg)
==================

<p align="center" style="text-align: center;">
    <img src="http://nnnnathann.github.io/angular-panhandler/images/demo.gif" alt="Demo"/>
</p>

Pan Directive for Angular.js - Drag to scroll behavior

### Usage

Add ```panhandler``` as an attribute to the element on which you would like to enable panning.  Thats it!  If you would like to make sure your inner content fits to a certain size, you can specify a ```content-{width|height}``` attribute.


### Advanced Usage

If you need to disable panning (temporarily) for some of the content elements,
you can set the `preventPan` attribute on the panhandler element to true.

This is useful in the case that you would like to enable drag-n-drop
for some elements within the pannable area.

### Example

Javascript

```javascript
angular.module('pannableExamples', ['panhandler'])
    .controller('Example1', function Example1($scope) {
      $scope.gridItems = generateGrid(30);
    });
```

HTML

```html
<div ng-app="pannableExamples">
  <div ng-controller="Example1">
    <div panhandler content-width="100em">
      Stuff to pan around!
    </div>
  </div>
</div>
```

### Prevent Example

HTML

```html
<div ng-app="pannableExamples">
  <div ng-controller="Example1">
    <input name="preventPan" type="checkbox" ng-model="preventPanCheck" />
    <label for="preventPan">Prevent Panning</label>
    <div panhandler content-width="100em" prevent-pan="{{ preventPanCheck }}">
      Stuff to pan around!
    </div>
  </div>
</div>
```

### Prevent Pan on item

HTML

```html
<div ng-app="pannableExamples">
  <div ng-controller="Example1">
    <input name="preventPan" type="checkbox" />
    <label for="preventPan">Prevent Panning</label>
    <div panhandler content-width="100em">
      <div class="iDoNotWantToScroll iCannotScroll"></div>
    </div>
  </div>
</div>
```

### Development

For development, you will need node.js installed.

After that, run the following from the repo directory

```bash
npm install grunt-cli bower -g
npm install
bower install
grunt
```

Should get you going!


### License

MIT License


### Contributors and Acknowledgements

Thanks goes out these contributors and/or users.

@gtczap
@ggggino
@Konkko
@civilframe
@amrsh

---
_Source: https://npm.io/package/angular-panhandler · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
