3 <title>The source code</title>
\r
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
7 <body onload="prettyPrint();">
\r
8 <pre class="prettyprint lang-js"><div id="cls-Ext.Element"></div>/**
\r
11 Ext.Element.addMethods({
\r
12 <div id="method-Ext.Element-isScrollable"></div>/**
\r
13 * Returns true if this element is scrollable.
\r
16 isScrollable : function(){
\r
18 return dom.scrollHeight > dom.clientHeight || dom.scrollWidth > dom.clientWidth;
\r
21 <div id="method-Ext.Element-scrollTo"></div>/**
\r
22 * 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
23 * @param {String} side Either "left" for scrollLeft values or "top" for scrollTop values.
\r
24 * @param {Number} value The new scroll value.
\r
25 * @return {Element} this
\r
27 scrollTo : function(side, value){
\r
28 this.dom["scroll" + (/top/i.test(side) ? "Top" : "Left")] = value;
\r
32 <div id="method-Ext.Element-getScroll"></div>/**
\r
33 * Returns the current scroll position of the element.
\r
34 * @return {Object} An object containing the scroll position in the format {left: (scrollLeft), top: (scrollTop)}
\r
36 getScroll : function(){
\r
40 docElement = doc.documentElement,
\r
45 if(d == doc || d == body){
\r
46 if(Ext.isIE && Ext.isStrict){
\r
47 l = docElement.scrollLeft;
\r
48 t = docElement.scrollTop;
\r
50 l = window.pageXOffset;
\r
51 t = window.pageYOffset;
\r
53 ret = {left: l || (body ? body.scrollLeft : 0), top: t || (body ? body.scrollTop : 0)};
\r
55 ret = {left: d.scrollLeft, top: d.scrollTop};
\r