diff options
Diffstat (limited to 'misc/drupal.js')
-rw-r--r-- | misc/drupal.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/misc/drupal.js b/misc/drupal.js index d6f7597c3..9d7ec8089 100644 --- a/misc/drupal.js +++ b/misc/drupal.js @@ -300,6 +300,24 @@ Drupal.getSelection = function (element) { }; /** + * Checks if position:fixed is supported. + * + * @return + * Boolean indicating whether or not position:fixed is supported. + * + * @see http://yura.thinkweb2.com/cft/#IS_POSITION_FIXED_SUPPORTED + */ +Drupal.positionFixedSupported = function () { + if (this._positionFixedSupported === undefined) { + var el = $('<div style="position:fixed; top:10px" />').appendTo(document.body); + this._positionFixedSupported = el[0].offsetTop === 10; + el.remove(); + } + + return this._positionFixedSupported; +}; + +/** * Build an error message from an AJAX response. */ Drupal.ajaxError = function (xmlhttp, uri) { |