Skip to content

Commit

Permalink
experimental addition of access to scrollTop in a content iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
lloyd committed May 18, 2011
1 parent d322f0c commit 738e1a3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modules/lib/web-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,15 @@ exports.title = function(frame) {
return frame.contentDocument.title;
};

/**
* Access the scrollTop an iframe.
* @params {IFrameNode} frame An iframe dom node.
* @returns {number} The current offset in pixels of the scrolling in the iframe.
*/
exports.scrollTop = function(frame) {
return frame.contentWindow.scrollY;
};

/**
* inject a function into a web content window
* @params {IFrameNode} frame An iframe dom node.
Expand Down

0 comments on commit 738e1a3

Please sign in to comment.