Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ngscrollto

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngscrollto

Simple AngularJS scroll-to directive

  • 0.0.7
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
64
increased by300%
Maintainers
2
Weekly downloads
 
Created
Source

ngScrollTo

NPM version NPM downloads

Simple AngularJS scroll-to directive

fiddle : http://jsfiddle.net/8Mtxc/230/

<div ng-app="myApp">
 <p>Top</p>
 <div>
   <a scroll-to="section1">Goto Section 1</a>
 </div>
 <div style="padding-top:1000px">...</div>
 <div id="section1">
  <h2>Section1</h2>
  <a scroll-to="">Back to Top</a>
 </div>
</div>

##Usage ###Default

angular.module("myApp", ["ngScrollTo"]);

###Custom action Example: http://jsfiddle.net/8Mtxc/231/


angular.module("myApp", ["ngScrollTo"])
.config(function(ngScrollToOptionsProvider) {
    ngScrollToOptionsProvider.extend({
        handler: function(el) {
          $(el).scrollintoview();
        }
    });
});

Update 0.0.7

  • Increase browser compatibility

Update 0.0.6

  • Remove jQuery dependency
  • Unbind element on directive destroy

Update 0.0.5

  • Added ngScrollToOptions provider.
  • Made scrollIntoView to be replaceable by a custom function.

Update 0.0.4

  • Added ScrollTo service for programatically scrolling.

Update 0.0.3

  • Added optional offset attribute. The optional offset attribute allows scrolling an element into view and offset it by a specified number of pixels.

Update 0.0.2

  • Made scrolling-to-top gets detected before searching for the target DOM element. (This change makes broken scroll-to link to be ignored instead of scrolling to top)
  • Removed unnecessary $parse dependency.

Keywords

FAQs

Package last updated on 01 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc