Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F121614557
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
Sat, Jul 12, 11:39
Size
434 B
Mime Type
text/x-java
Expires
Mon, Jul 14, 11:39 (2 d)
Engine
blob
Format
Raw Data
Handle
27358991
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