PDA

View Full Version : ContentPanel problem with absolute positioning



tristan
24 May 2007, 12:15 PM
Greetings,

I am having some issues with absolute-positioned elements inside of a ContentPanel. Specifically, the element moves when you scroll as though it is using 'position: fixed'. This problem is only occurring in Firefox, both on Mac OS X and Windows, but works properly in IE6. Any help would be greatly appreciated.

Here's a code snippet:
<div id='center'>
<div style='height:500px'>MAKE SCROLL</div>
<div style='position:absolute; top:10px; left:10px;'>SHOULD NOT MOVE</div>
</div>
<script type='text/javascript'>
Example = function(){
return {
init : function(){
var layout = new Ext.BorderLayout(document.body, {
center: {
autoScroll: true
}
});
layout.beginUpdate();
layout.add('center', new Ext.ContentPanel('center'));
layout.endUpdate();
}
};
}();
Ext.EventManager.onDocumentReady(Example.init, Example, true);
</script>

Thanks!
Tristan