Date: 11/29/07 (Code WTF) Keywords: html this.cell.childNodes[1].childNodes[3].childNodes[1].firstChild.data=this.name; this.cell.childNodes[1].childNodes[3].childNodes[3].childNodes[5].childNodes[0].data=fields_name(top.opener.pictures[this.id].fields); this.cell.childNodes[1].childNodes[3].childNodes[3].childNodes[9].childNodes[0].data=top.opener.paper.price; this.cell.childNodes[1].childNodes[3].childNodes[3].childNodes[13].childNodes[0].data=top.opener.pictures[this.id].count; this.cell.childNodes[1].childNodes[3].childNodes[3].childNodes[19].childNodes[1].childNodes[0].data=mceil(top.opener.pictures[this.id].count*top.opener.paper.price); Шедевр 2 count: function(newcount){
if(top.opener.pictures[this.id].count){
top.opener.pictures[this.id].old=top.opener.pictures[this.id].count;
this.cell.childNodes[1].childNodes[5].style.display='';
the_gal2.recount(0-top.opener.pictures[this.id].count,-1);
top.opener.pictures[this.id].count=0;
}else{
this.cell.childNodes[1].childNodes[5].style.display='none';
top.opener.pictures[this.id].count=top.opener.pictures[this.id].old;
the_gal2.recount(top.opener.pictures[this.id].count,1);
}
this.cell.childNodes[1].childNodes[3].childNodes[3].childNodes[13].childNodes[0].data=top.opener.pictures[this.id].count;
this.cell.childNodes[1].childNodes[3].childNodes[3].childNodes[19].childNodes[1].childNodes[0].data=mceil(top.opener.pictures[this.id].count*top.opener.paper.price);
}Смысл в следующем. Этот код меняет текст и атрибуты у некоторого подмножества HTML тегов через DOM. При малейшем изменении верстки циферки у childNodes[#] нужно пересчитывать заново =) Source: http://community.livejournal.com/code_wtf/115613.html
|