3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <title>The source code</title>
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <body onload="prettyPrint();">
9 <pre class="prettyprint lang-js">/*!
10 * Ext JS Library 3.2.1
11 * Copyright(c) 2006-2010 Ext JS, Inc.
13 * http://www.extjs.com/license
18 Ext.Element.addMethods({
19 <div id="method-Ext.Element-isScrollable"></div>/**
20 * Returns true if this element is scrollable.
23 isScrollable : function(){
25 return dom.scrollHeight > dom.clientHeight || dom.scrollWidth > dom.clientWidth;
28 <div id="method-Ext.Element-scrollTo"></div>/**
29 * 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().
30 * @param {String} side Either "left" for scrollLeft values or "top" for scrollTop values.
31 * @param {Number} value The new scroll value.
32 * @return {Element} this
34 scrollTo : function(side, value){
35 this.dom["scroll" + (/top/i.test(side) ? "Top" : "Left")] = value;
39 <div id="method-Ext.Element-getScroll"></div>/**
40 * Returns the current scroll position of the element.
41 * @return {Object} An object containing the scroll position in the format {left: (scrollLeft), top: (scrollTop)}
43 getScroll : function(){
47 docElement = doc.documentElement,
52 if(d == doc || d == body){
53 if(Ext.isIE && Ext.isStrict){
54 l = docElement.scrollLeft;
55 t = docElement.scrollTop;
57 l = window.pageXOffset;
58 t = window.pageYOffset;
60 ret = {left: l || (body ? body.scrollLeft : 0), top: t || (body ? body.scrollTop : 0)};
62 ret = {left: d.scrollLeft, top: d.scrollTop};