Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F95051199
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
Thu, Dec 12, 11:32
Size
434 B
Mime Type
text/x-java
Expires
Sat, Dec 14, 11:32 (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