Posseidon
未读,2008年9月19日 12:40:382008/9/19登录即可回复作者
登录即可转发
您无权在此群组中删除帖子
请登录以举报消息
要么此群组的电子邮件地址为匿名状态,要么您得查看成员电子邮件地址权限才能查看原始帖子
收件人 Prototype & script.aculo.us
Hi guys!
i have made a little class to create textboxes!
here is the code:
var loadingWindow = Class.create();
loadingWindow.prototype = {
initialize: function()
{
this.disableDiv = new Element('div',
{ id:'disableDiv' });
this.disableDiv.insert( {top: new
Element('img', { id:'loadingGif', src:'pics/site/loading.gif',
style:'position:absolute; z-index:11; border:0px;' } ) });
this.disableDiv.addClassName('blankdiv');
},
createLoadingWindow: function( elementID )
{
var elHeight = $
( elementID ).getHeight();
if( !$('disableDiv') )
{
pageHuelle = $
( elementID ).insert( { top: this.disableDiv } );
$
('disableDiv').setStyle( { height:elHeight + 'px' } );
$
('disableDiv').down('img').setStyle( { top:elHeight*0.3 + 'px' } );
}
},
disableLoadingWindow: function()
{
if( $('disableDiv') ) $
('disableDiv').remove();
}
};
yes i know it is not pretty JS Code but it works fine in all browsers
except Chrome!
Chrome allways says the following error Message when starting my site:
Uncaught TypeError: Object [object HTMLDivElement] has no method
'insert' on line 12
its the line with this code: this.disableDiv.insert( {top: new
Element('img', { id:'loadingGif',..... and so on...
What is the problem on this? it seems that Chrome doesnot extend new
Elements!
How can i fix this?
Thank you
Greetz
Possal