3 * Copyright(c) 2006-2009 Ext JS, LLC
5 * http://www.extjs.com/license
10 Ext.Element.addMethods({
\r
12 * Returns true if this element is scrollable.
\r
15 isScrollable : function(){
\r
17 return dom.scrollHeight > dom.clientHeight || dom.scrollWidth > dom.clientWidth;
\r
21 * 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
22 * @param {String} side Either "left" for scrollLeft values or "top" for scrollTop values.
\r
23 * @param {Number} value The new scroll value.
\r
24 * @return {Element} this
\r
26 scrollTo : function(side, value){
\r
27 this.dom["scroll" + (/top/i.test(side) ? "Top" : "Left")] = value;
\r
32 * Returns the current scroll position of the element.
\r
33 * @return {Object} An object containing the scroll position in the format {left: (scrollLeft), top: (scrollTop)}
\r
35 getScroll : function(){
\r
39 docElement = doc.documentElement,
\r
44 if(d == doc || d == body){
\r
45 if(Ext.isIE && Ext.isStrict){
\r
46 l = docElement.scrollLeft;
\r
47 t = docElement.scrollTop;
\r
49 l = window.pageXOffset;
\r
50 t = window.pageYOffset;
\r
52 ret = {left: l || (body ? body.scrollLeft : 0), top: t || (body ? body.scrollTop : 0)};
\r
54 ret = {left: d.scrollLeft, top: d.scrollTop};
\r