UNPKG
choo-shortcache
Version:
latest (0.0.0)
0.0.0
choo nanocomponent cache shortcut
choo-shortcache
/
example
/
node_modules
/
scroll-to-anchor
/
index.js
11 lines
(9 loc)
•
215 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
module
.
exports
= scrollToAnchor
function
scrollToAnchor
(
anchor, options
) {
if
(anchor) {
try
{
var
el =
document
.
querySelector
(anchor)
if
(el) el.
scrollIntoView
(options) }
catch
(e) {} } }