Показать сообщение отдельно
Старый 24.05.2012, 20:15
stweet вне форума Посмотреть профиль Отправить личное сообщение для stweet Найти все сообщения от stweet
  № 1  
Ответить с цитированием
stweet
 
Аватар для stweet

Регистрация: Mar 2010
Адрес: 54.713862552265084 = 20.442724227905273
Сообщений: 449
Отправить сообщение для stweet с помощью Skype™
По умолчанию Создание объектов(классов).

Что то я ни как не могу понять как создать индивидуальный объект.
Код:
function MainClass (id) {
   
   this.idClass = "panel_" + id;
   
   this.interactivPanel = document.createElement('div');
   this.interactivPanel.onmouseover = this.onMouseOver;
   this.interactivPanel.onmouseout = this.onMouseOut;
   this.interactivPanel.innerHTML = this.idClass;
   this.interactivPanel.id = this.idClass;
   this.interactivPanel.style.background = "#666";
   this.interactivPanel.style.position = "absolute";
   this.interactivPanel.style.cursor = "default";
   this.interactivPanel.style.height = "50px";
   this.interactivPanel.style.width = "950px";
   this.interactivPanel.style.left = "25px";
   this.interactivPanel.style.zIndex = "10";
   this.interactivPanel.style.overflow = "hidden";
   
   this.viewerPanel = document.getElementById(id);
   this.viewerPanel.innerHTML = '';
   this.viewerPanel.align = "center";
   this.viewerPanel.style.position = 'relative';
   this.viewerPanel.style.height = '20px';
   this.viewerPanel.style.width = '1000px';
   this.viewerPanel.appendChild(this.interactivPanel);
}

MainClass.prototype.onMouseOver = function ( ) {
   document.getElementById("trace").innerHTML = "over: " + this.idClass; // undefened ???
}

MainClass.prototype.onMouseOut = function ( ) {
   document.getElementById("trace").innerHTML = "out: " + this.idClass; // undefened ???
}
Заранее очень буду благодарен, 2 дня уже воюю с этим javascript.
__________________
Спросишь, дурак на минуту. Если не спросишь, дурак на всю жизнь!