Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F95164866
getScrollAccessor.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Dec 13, 09:21
Size
434 B
Mime Type
text/x-java
Expires
Sun, Dec 15, 09:21 (2 d)
Engine
blob
Format
Raw Data
Handle
22916401
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
getScrollAccessor.js
View Options
import
isWindow
from
'./isWindow'
;
export
default
function
getscrollAccessor
(
offset
)
{
var
prop
=
offset
===
'pageXOffset'
?
'scrollLeft'
:
'scrollTop'
;
function
scrollAccessor
(
node
,
val
)
{
var
win
=
isWindow
(
node
);
if
(
val
===
undefined
)
{
return
win
?
win
[
offset
]
:
node
[
prop
];
}
if
(
win
)
{
win
.
scrollTo
(
win
[
offset
],
val
);
}
else
{
node
[
prop
]
=
val
;
}
}
return
scrollAccessor
;
}
Event Timeline
Log In to Comment