dojo/dom-geometry::docScroll()¶
Project owner: | Eugene Lazutkin |
---|---|
since: | V1.7 |
Returns a normalized object with {x, y}
with corresponding offsets for the scroll position for the current document.
Attributes¶
This function requires no arguments, and references the current document.
Examples¶
require(["dojo/dom-geometry", "dojo/dom", "dojo/on", "dojo/json", "dojo/domReady!"],
function(domGeom, dom, on, JSON){
on(dom.byId("command"), "click", function(){
var output = domGeom.docScroll();
dom.byId("output").innerHTML = JSON.stringify(output);
});
});
<div> </div><div> </div><div> </div><div> </div><div> </div><div> </div>
<button id="command" type="button">Execute docScroll()</button>
<pre id="output"></pre>
<div> </div><div> </div><div> </div><div> </div><div> </div><div> </div>
<div> </div><div> </div><div> </div><div> </div><div> </div><div> </div>
<div> </div><div> </div><div> </div><div> </div><div> </div><div> </div>