{"name":"scroll-into-view","version":"1.16.0","description":"scrolls an elements into view, recursively aligning parents.","main":"scrollIntoView.js","directories":{"test":"test"},"repository":{"type":"git","url":"git+ssh://git@github.com/KoryNunn/scroll-into-view.git"},"scripts":{"test":"browserify ./test/test.js | tape-run","build":"browserify ./example/index.js > ./example/index.browser.js & browserify --bare -g uglifyify ./standalone.js > ./scrollIntoView.min.js","watchTest":"watchify ./test/test.js -d -o ./test/test.browser.js","watchExample":"watchify ./example/index.js -d -o ./example/index.browser.js","prepublish":"npm run-script build","serve":"static example","serveTest":"static test","start":"npm-run-all -p serve watchExample","startTest":"npm-run-all -p serveTest watchTest"},"author":"","license":"MIT","devDependencies":{"browserify":"^14.4.0","chlogit":"^1.0.2","crel":"^1.1.1","node-static":"^0.7.11","npm-run-all":"^4.1.5","tape":"~2.1.0","tape-run":"^6.0.1","uglifyify":"^4.0.2","watchify":"^3.9.0"},"dependencies":{},"collective":{"type":"opencollective","url":"https://opencollective.com/scroll-into-view"},"keywords":["scroll into view","scrollIntoView","scroll into view if needed","smooth scroll","scroll parents"],"gitHead":"5f2ef3910d1f8c206f015f01c22466299cc3d8d3","bugs":{"url":"https://github.com/KoryNunn/scroll-into-view/issues"},"homepage":"https://github.com/KoryNunn/scroll-into-view#readme","_id":"scroll-into-view@1.16.0","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-N8T/4mKzQXMorcbMzNm+rOfy0lPmga3zl7SmUSHDryA6cqGVlzG9pePQCqHA/UPaJtC2KOJP/r93pHm9df+5/A==","shasum":"07141fc4ba8a14b898d2163d6167f3d84cb9b05b","tarball":"http://registry-npm.ywwl.com/scroll-into-view/download/scroll-into-view-1.16.0.tgz","fileCount":6,"unpackedSize":22261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0Q5lCRA9TVsSAnZWagAAbegQAIElWNzHq6at9pKAvlV6\nrJALiC+cgaDSjHoQt4KxkRCaJe/GldJQMQ0CuC5pvTtzyZMCHTtMxbBfVjvE\nkUqlgT3fs4Fx7M7RAwlkU/cFg6nxdWi5A+Mq/JfzKRju3XXFcKcLUJPBGn/e\nkZoby6piXtjkgYmWtL6x7vc6AIsKBoX9Omt6PPL3wZSbJieK6MXfhWAAtEKv\nh1we6vTE3zyJspGtGkM3uKdL+NINIzrYoqpTUBrbciGWEsWhIJTtPk9bxE0N\nCLiKyYGHB8K0ZNSUQEEJQSn02D7iU6/LuTfLLBzJ28dEFcdWg2fLLseO9ueY\ngeCTXRuG+WXfD9YpgAgnhDnxmGwjHaJIIiguqnCBaJ6N1vUaEqmCmwPbSmCH\n1Z5I2KsGOgdlqwGWga2vSoXj/A5t18NQiiaIaoZaEgAyRi5dUcZF64qtd0y5\n7bj+vwwE6d7fGW7z4uvOYbV9I0tyuLuwPOrmtrN8JxkLhqzYMY+9oKb2kReu\nj5us+bZU944wdoMXBm8Po2WYUgW6ZquKeB9tcpktsJMo2reXc1WkiM4qhPB2\nVECFs6FG7LhR28ZLHJz1ZkRUBIg76nsu6+7cnXG9mUsdxI14z08oxg5kVk0/\nAuD7ezE8dl9GRfXFIyA9Ag5i9Ou+6hmCAGAHQlADAPy3a0MI/TMTawmP3Cax\nsSPs\r\n=04Te\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHmC0G04r7eKG5AkawqYFLkHpXzqQ++WIze8TGxJIWbYAiBAVf0TWB+GmyHuYjzIVLf8cISo8hrRiyzqSGrseWRAVQ=="}],"size":6906,"noattachment":false,"key":"/scroll-into-view/-/scroll-into-view-1.16.0.tgz"},"_npmUser":{"name":"korynunn","email":"knunn187@gmail.com"},"maintainers":[{"name":"korynunn","email":"knunn187@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/scroll-into-view_1.16.0_1624313445339_0.20766262507244448"},"_hasShrinkwrap":false,"readme":"\n![scroll-into-view](/scrollintoview.png) ![example-gif](/scrollIntoViewExample.gif)\n\n[![Build Status](https://travis-ci.org/KoryNunn/scroll-into-view.svg?branch=master)](https://travis-ci.org/KoryNunn/scroll-into-view)\n[![Backers on Open Collective](https://opencollective.com/scroll-into-view/backers/badge.svg)](#backers)\n[![Sponsors on Open Collective](https://opencollective.com/scroll-into-view/sponsors/badge.svg)](#sponsors)\n## What\n\nScrolls an element into view\n\nAlso scrolls any scroll-parents so that the element is in view.\n\n## Donating\n\nIf you want to show your support financially, [I'm on Patreon](https://patreon.com/user/korynunn)\n\n## Example\n\n[Example](http://korynunn.github.io/scroll-into-view/example/)\n\n## How\n\nrequire it\n```javascript\nvar scrollIntoView = require('scroll-into-view');\n```\nuse it\n\n```javascript\nscrollIntoView(someElement);\n```\n\nYou can pass settings to control the time, easing, and whether or not a parent is a valid element to scroll, and alignment:\n\nAll options are optional.\n\n```javascript\nscrollIntoView(someElement, {\n\n    time: 500, // half a second\n\n\n    ease: function(value){\n        return Math.pow(value,2) - value; // Do something weird.\n    },\n\n    validTarget: function(target, parentsScrolled){\n\n        // Only scroll the first two elements that don't have the class \"dontScroll\"\n        // Element.matches is not supported in IE11, consider using Element.prototype.msMatchesSelector if you need to support that browser\n\n        return parentsScrolled < 2 && target !== window && !target.matches('.dontScroll');\n    },\n\n    align:{\n        top: 0 to 1, default 0.5 (center)\n        left: 0 to 1, default 0.5 (center)\n        topOffset: pixels to offset top alignment\n        leftOffset: pixels to offset left alignment,\n        lockX: boolean to prevent X scrolling,\n        lockY: boolean to prevent Y scrolling\n    },\n\n    isScrollable: function(target, defaultIsScrollable){\n\n        // By default scroll-into-view will only attempt to scroll elements that have overflow not set to `\"hidden\"` and who's scroll width/height is larger than their client height.\n        // You can override this check by passing an `isScrollable` function to settings:\n\n        return defaultIsScrollable(target) || target !== window && ~target.className.indexOf('scrollable');\n    },\n\n    isWindow: function(target){\n        // If you need special detection of the window object for some reason, you can do it here.\n        return target.self === target;\n    },\n\n    cancellable: true, // default is true, set to false to prevent users from cancelling the scroll with a touch or mousewheel\n\n    maxSynchronousAlignments: 3, // default is 3. Maximum number of times to try and align elements synchronously before completing.\n\n    debug: true // default is false. This will spit out some logs that can help you understand what scroll-into-view is doing if it isn't doing what you expect.\n});\n```\n\nYou can pass a callback that will be called when all scrolling has been completed or canceled.\n\n```javascript\nscrollIntoView(someElement [, settings], function(type){\n    // Scrolling done.\n    // type will be 'complete' if the scroll completed or 'canceled' if the current scroll was canceled by a new scroll\n});\n```\n\nYou can cancel the current scroll by using the cancel function returned by scrollIntoView:\n\n```javascript\nvar cancel = scrollIntoView(someElement);\n\n// ... later ...\n\ncancel()\n```\n\n## Size\n\nSmall. ~3.03 KB for the standalone.\n\n## Changelog\n\n[View Changeog](https://changelogit.korynunn.com/#korynunn/scroll-into-view)\n\n## Testing\n\nTesting scrolling is really hard without stuff like webdriver, but what's there works ok for the moment.\n\nThe tests will attempt to launch google-chrome. If you don't have chrome, lol just kidding you do.\n\n```\nnpm run test\n```\n\n# Standalone\n\nIf you want to use this module without browserify, you can use `scrollIntoView.min.js`\n\n```\n<script src=\"scrollIntoView.min.js\"></script>\n\n<script>\n    window.scrollIntoView(someElement);\n</script>\n```\n\n# Browser support\n\nAll evergreen browsers are supported.\n\nYes this means IE11 is not supported, scroll-into-view has the same support targets as microsoft: https://www.zdnet.com/article/microsoft-sets-deadline-for-end-of-support-of-ie-11-by-365-apps/ \n\n## Contributors\n\nThis project exists thanks to all the people who contribute.\n<a href=\"https://github.com/KoryNunn/scroll-into-view/graphs/contributors\"><img src=\"https://opencollective.com/scroll-into-view/contributors.svg?width=890&button=false\" /></a>\n\n\n## Backers\n\nThank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/scroll-into-view#backer)]\n\n<a href=\"https://opencollective.com/scroll-into-view#backers\" target=\"_blank\"><img src=\"https://opencollective.com/scroll-into-view/backers.svg?width=890\"></a>\n\n\n## Sponsors\n\nSupport this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/scroll-into-view#sponsor)]\n\n<a href=\"https://opencollective.com/scroll-into-view/sponsor/0/website\" target=\"_blank\"><img src=\"https://opencollective.com/scroll-into-view/sponsor/0/avatar.svg\"></a>\n<a href=\"https://opencollective.com/scroll-into-view/sponsor/1/website\" target=\"_blank\"><img src=\"https://opencollective.com/scroll-into-view/sponsor/1/avatar.svg\"></a>\n<a href=\"https://opencollective.com/scroll-into-view/sponsor/2/website\" target=\"_blank\"><img src=\"https://opencollective.com/scroll-into-view/sponsor/2/avatar.svg\"></a>\n<a href=\"https://opencollective.com/scroll-into-view/sponsor/3/website\" target=\"_blank\"><img src=\"https://opencollective.com/scroll-into-view/sponsor/3/avatar.svg\"></a>\n<a href=\"https://opencollective.com/scroll-into-view/sponsor/4/website\" target=\"_blank\"><img src=\"https://opencollective.com/scroll-into-view/sponsor/4/avatar.svg\"></a>\n<a href=\"https://opencollective.com/scroll-into-view/sponsor/5/website\" target=\"_blank\"><img src=\"https://opencollective.com/scroll-into-view/sponsor/5/avatar.svg\"></a>\n<a href=\"https://opencollective.com/scroll-into-view/sponsor/6/website\" target=\"_blank\"><img src=\"https://opencollective.com/scroll-into-view/sponsor/6/avatar.svg\"></a>\n<a href=\"https://opencollective.com/scroll-into-view/sponsor/7/website\" target=\"_blank\"><img src=\"https://opencollective.com/scroll-into-view/sponsor/7/avatar.svg\"></a>\n<a href=\"https://opencollective.com/scroll-into-view/sponsor/8/website\" target=\"_blank\"><img src=\"https://opencollective.com/scroll-into-view/sponsor/8/avatar.svg\"></a>\n<a href=\"https://opencollective.com/scroll-into-view/sponsor/9/website\" target=\"_blank\"><img src=\"https://opencollective.com/scroll-into-view/sponsor/9/avatar.svg\"></a>\n\n\n","publish_time":1624313445470,"_cnpm_publish_time":1624313445470,"dist-tags":{"latest":"1.16.2"}}