3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
\r
4 <title>The source code</title>
\r
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
8 <body onload="prettyPrint();">
\r
9 <pre class="prettyprint lang-js">/**
\r
10 * @class Ext.Element
\r
12 Ext.Element.addMethods({
\r
13 <div id="method-Ext.Element-isScrollable"></div>/**
\r
14 * Returns true if this element is scrollable.
\r
17 isScrollable : function(){
\r
19 return dom.scrollHeight > dom.clientHeight || dom.scrollWidth > dom.clientWidth;
\r
22 <div id="method-Ext.Element-scrollTo"></div>/**
\r
23 * Scrolls this element the specified scroll point. It does NOT do bounds checking so if you scroll to a weird value it will try to do it. For auto bounds checking, use scroll().
\r
24 * @param {String} side Either "left" for scrollLeft values or "top" for scrollTop values.
\r
25 * @param {Number} value The new scroll value.
\r
26 * @return {Element} this
\r
28 scrollTo : function(side, value){
\r
29 this.dom["scroll" + (/top/i.test(side) ? "Top" : "Left")] = value;
\r
33 <div id="method-Ext.Element-getScroll"></div>/**
\r
34 * Returns the current scroll position of the element.
\r
35 * @return {Object} An object containing the scroll position in the format {left: (scrollLeft), top: (scrollTop)}
\r
37 getScroll : function(){
\r
41 docElement = doc.documentElement,
\r
46 if(d == doc || d == body){
\r
47 if(Ext.isIE && Ext.isStrict){
\r
48 l = docElement.scrollLeft;
\r
49 t = docElement.scrollTop;
\r
51 l = window.pageXOffset;
\r
52 t = window.pageYOffset;
\r
54 ret = {left: l || (body ? body.scrollLeft : 0), top: t || (body ? body.scrollTop : 0)};
\r
56 ret = {left: d.scrollLeft, top: d.scrollTop};
\r