gnddavid
10 Aug 2009, 5:41 AM
(1) One question for compute scrollbar width
I can't right compute web browser scrollbar width for IE6,7,8,look:
var __CONSTANTS_SCOLLER_WIDTH = Ext.getBody().getWidth()-Ext.getBody().getViewSize().width;
but I only get __CONSTANTS_SCOLLER_WIDTH is '0'.Otherwise In FF it's '16'.
how can I right compute web browser scrollbar width for IE6,7,8?
(2) Two question for IE6,7 because DOCTYPE
I define DOCTYPE in html,such as
<!DOCTYPEhtmlPUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
and
Ext.ns('Ext.ux');
Ext.ux.Panel = Ext.extend(Ext.util.Observable,{
constructor: function(elId, config) {
config = config || {};
Ext.apply(this, config);
Ext.ux.Panel.superclass.constructor.call(this, config);
this.el = this.el? this.el : Ext.get(elId);
this.el.setStyle('cursor','default');
this.initEvents();
this.el.setLeft(0);
this.el.setTop(0);
this.el.setWidth(200);
this.el.setHeight(200);
},
initEvents: function() {
Ext.EventManager.on(Ext.getBody(),"mousedown",this.onBodyMouseDown,this);
},
onBodyMouseDown:function() {
alert(0);
}
});
Now in test.html
<!DOCTYPEhtmlPUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
... ...
<div id="pdiv" ></div>
<script language="javascript">
Ext.onReady(function(){
new Ext.ux.Panel('pdiv');
});
</script>
then ,I mouse down the div , but not alert '0'.
but I remove the DOCTYPE.I mouse down the div,then can alert '0';
I think Ext.EventManager - DOCTYPE bug?How can fix it?
Thanks!
I can't right compute web browser scrollbar width for IE6,7,8,look:
var __CONSTANTS_SCOLLER_WIDTH = Ext.getBody().getWidth()-Ext.getBody().getViewSize().width;
but I only get __CONSTANTS_SCOLLER_WIDTH is '0'.Otherwise In FF it's '16'.
how can I right compute web browser scrollbar width for IE6,7,8?
(2) Two question for IE6,7 because DOCTYPE
I define DOCTYPE in html,such as
<!DOCTYPEhtmlPUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
and
Ext.ns('Ext.ux');
Ext.ux.Panel = Ext.extend(Ext.util.Observable,{
constructor: function(elId, config) {
config = config || {};
Ext.apply(this, config);
Ext.ux.Panel.superclass.constructor.call(this, config);
this.el = this.el? this.el : Ext.get(elId);
this.el.setStyle('cursor','default');
this.initEvents();
this.el.setLeft(0);
this.el.setTop(0);
this.el.setWidth(200);
this.el.setHeight(200);
},
initEvents: function() {
Ext.EventManager.on(Ext.getBody(),"mousedown",this.onBodyMouseDown,this);
},
onBodyMouseDown:function() {
alert(0);
}
});
Now in test.html
<!DOCTYPEhtmlPUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
... ...
<div id="pdiv" ></div>
<script language="javascript">
Ext.onReady(function(){
new Ext.ux.Panel('pdiv');
});
</script>
then ,I mouse down the div , but not alert '0'.
but I remove the DOCTYPE.I mouse down the div,then can alert '0';
I think Ext.EventManager - DOCTYPE bug?How can fix it?
Thanks!