X-Git-Url: https://scm.cri.mines-paristech.fr/git/Plinn.git/blobdiff_plain/497dc01810e6f02731c0e13fa43a63384e9261ef..31d7923e80d897c9297da71348b3336478a5214e:/skins/ajax_scripts/javascript_events_api.js diff --git a/skins/ajax_scripts/javascript_events_api.js b/skins/ajax_scripts/javascript_events_api.js index 94960c0..2539fd9 100644 --- a/skins/ajax_scripts/javascript_events_api.js +++ b/skins/ajax_scripts/javascript_events_api.js @@ -45,6 +45,8 @@ function buildMetaFunctions() { disablePropagation = _build_disablePropagation(); getWindowWidth = _build_getWindowWidth(); getWindowHeight = _build_getWindowHeight(); + getWindowScrollX = _build_getWindowScrollX(); + getWindowScrollY = _build_getWindowScrollY(); clearSelection = _build_clearSelection(); } @@ -210,6 +212,32 @@ function _build_getWindowHeight() { } } +function _build_getWindowScrollX() { + if (window.scrollX !== undefined) { + return function(){ + return window.scrollX; + }; + } + else { + return function(){ + return document.documentElement.scrollLeft; + }; + } +} + +function _build_getWindowScrollY() { + if (window.scrollY !== undefined) { + return function(){ + return window.scrollY; + }; + } + else { + return function(){ + return document.documentElement.scrollTop; + }; + } +} + function _build_clearSelection() { if (document.selection) { return function() {