Reputation: 38
I've just noticed that the .scroll
and scrollTo
methods are undefined
when invoked on DOM elements in Safari. Chrome and Firefox seem to handle the issue right.
I've added this jsfiddle to ilustrate the problem. Open it in Chrome, Firefox and Safari to and check the Console panel. I'm on a mac, by the way.
Do you know of any alternative or woraround?
Upvotes: 1
Views: 1457
Reputation: 47801
The .scrollLeft
and .scrollTop
properties are well supported in current browsers, including Safari, and can be used to get or change horizontal and vertical scrolling offset.
element.scrollLeft = x;
element.scrollTop = y;
Upvotes: 2
Reputation: 4916
Chrome is throwing undefined for me as well. I think these methods are only window
methods see w3 schools reference here.
Upvotes: 0