Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F121709282
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
Sun, Jul 13, 08:43
Size
434 B
Mime Type
text/x-java
Expires
Tue, Jul 15, 08:43 (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