Suche im Forum:
Suchen


« Vorheriges Thema anzeigen :: Nächstes Thema anzeigen »  
Autor Nachricht
Beitrag31.12.2011 um 10:46 (UTC)    
Titel: Farbe in Javascript

wie bekomme ich in diesen Code die Hintergundfarbe #C0C0C0 ?
Es ist eine kleine Tabelle unter der Navi.

<script type="text/javascript">
var boxHeaderContent="",boxContentContent='<table width="181" border="2"><tr><td colspan="2"> <center> RLP-Liga 2011/2012 nach 2 Spielen</td></tr><tr><td>1.Tr-Trarbach I 34:2 </td><td>2.Rodalben I 30:6</td></tr><tr><td>3.Bad Kreuznach 30:6 </td><td>4.Ludwigshafen II 21:15 </td></tr><tr><td>5.Bad Bodendorf 20:16 </td><td>6.Hachenburg 16:20 </td></tr><tr><td>7.Worms 13:19 </td><td>8.Bad Ems 08:28 </td></tr><tr><td>9.Rodalben II 06:30 </td><td>10.Tr-Trarbach II 02:34 </td></tr></table> ',boxFooterContent="",i,found=!1,elementBefore,aNewTable= document.createElement("table"),boxHeaderRow=document.createElement("tr"),boxContentRow=document.createElement("tr"),boxFooterRow=document.createElement("tr"),boxHeaderTd=document.createElement("td"),boxContentTd=document.createElement("td"),boxFooterTd=document.createElement("td"),newHeaderDiv=document.createElement("div"),newContentDiv=document.createElement("div"),newFooterDiv=document.createElement("div"),allTds=document.getElementsByTagName("td");newHeaderDiv.id="hdiv_for_ie"; newContentDiv.id="cdiv_for_ie";newFooterDiv.id="fdiv_for_ie";for(i=0;i<allTds.length&&!found;i++)"edit_below_nav"==allTds[i].className&&(elementBefore=allTds[i],found=!0);boxHeaderTd.appendChild(newHeaderDiv);boxHeaderRow.appendChild(boxHeaderTd);boxHeaderRow.id="navi_shout_box_header";aNewTable.appendChild(boxHeaderRow);boxContentTd.appendChild(newContentDiv);boxContentRow.appendChild(boxContentTd);boxContentRow.id="navi_shout_box_content";aNewTable.appendChild(boxContentRow);boxFooterTd.appendChild(newFooterDiv); boxFooterRow.appendChild(boxFooterTd);aNewTable.appendChild(boxFooterRow);boxFooterRow.id="navi_shout_box_footer";aNewTable.id="navi_shout_box";elementBefore.insertBefore(aNewTable,elementBefore.firstChild);newHeaderDiv.innerHTML=boxHeaderContent;newContentDiv.innerHTML=boxContentContent;newFooterDiv.innerHTML=boxFooterContent;
</script>

Danke und guten Rutsch !
Beitrag31.12.2011 um 11:12 (UTC)    
Titel:

Code:
<script type="text/javascript">
var boxHeaderContent="",boxContentContent='<table style="background-color: #C0C0C0;" width="181" border="2"><tr><td colspan="2"> <center> RLP-Liga 2011/2012 nach 2 Spielen</td></tr><tr><td>1.Tr-Trarbach I 34:2 </td><td>2.Rodalben I 30:6</td></tr><tr><td>3.Bad Kreuznach 30:6 </td><td>4.Ludwigshafen II 21:15 </td></tr><tr><td>5.Bad Bodendorf 20:16 </td><td>6.Hachenburg 16:20 </td></tr><tr><td>7.Worms 13:19 </td><td>8.Bad Ems 08:28 </td></tr><tr><td>9.Rodalben II 06:30 </td><td>10.Tr-Trarbach II 02:34 </td></tr></table> ',boxFooterContent="",i,found=!1,elementBefore,aNewTable= document.createElement("table"),boxHeaderRow=document.createElement("tr"),boxContentRow=document.createElement("tr"),boxFooterRow=document.createElement("tr"),boxHeaderTd=document.createElement("td"),boxContentTd=document.createElement("td"),boxFooterTd=document.createElement("td"),newHeaderDiv=document.createElement("div"),newContentDiv=document.createElement("div"),newFooterDiv=document.createElement("div"),allTds=document.getElementsByTagName("td");newHeaderDiv.id="hdiv_for_ie"; newContentDiv.id="cdiv_for_ie";newFooterDiv.id="fdiv_for_ie";for(i=0;i<allTds.length&&!found;i++)"edit_below_nav"==allTds[i].className&&(elementBefore=allTds[i],found=!0);boxHeaderTd.appendChild(newHeaderDiv);boxHeaderRow.appendChild(boxHeaderTd);boxHeaderRow.id="navi_shout_box_header";aNewTable.appendChild(boxHeaderRow);boxContentTd.appendChild(newContentDiv);boxContentRow.appendChild(boxContentTd);boxContentRow.id="navi_shout_box_content";aNewTable.appendChild(boxContentRow);boxFooterTd.appendChild(newFooterDiv); boxFooterRow.appendChild(boxFooterTd);aNewTable.appendChild(boxFooterRow);boxFooterRow.id="navi_shout_box_footer";aNewTable.id="navi_shout_box";elementBefore.insertBefore(aNewTable,elementBefore.firstChild);newHeaderDiv.innerHTML=boxHeaderContent;newContentDiv.innerHTML=boxContentContent;newFooterDiv.innerHTML=boxFooterContent;
</script>


mfg Philipp
______________
Forenregeln, FAQ, Suchfunktion
Beitrag02.01.2012 um 15:32 (UTC)    
Titel:

Danke prima !
Und wie kann ich in diesem Code die Textfarbe ändern ?
Beitrag02.01.2012 um 15:36 (UTC)    
Titel:

Zitat:
<script type="text/javascript">
var boxHeaderContent="",boxContentContent='<table style="background-color: #C0C0C0; color: #000000;" width="181" border="2"><tr><td colspan="2"> <center> RLP-Liga 2011/2012 nach 2 Spielen</td></tr><tr><td>1.Tr-Trarbach I 34:2 </td><td>2.Rodalben I 30:6</td></tr><tr><td>3.Bad Kreuznach 30:6 </td><td>4.Ludwigshafen II 21:15 </td></tr><tr><td>5.Bad Bodendorf 20:16 </td><td>6.Hachenburg 16:20 </td></tr><tr><td>7.Worms 13:19 </td><td>8.Bad Ems 08:28 </td></tr><tr><td>9.Rodalben II 06:30 </td><td>10.Tr-Trarbach II 02:34 </td></tr></table> ',boxFooterContent="",i,found=!1,elementBefore,aNewTable= document.createElement("table"),boxHeaderRow=document.createElement("tr"),boxContentRow=document.createElement("tr"),boxFooterRow=document.createElement("tr"),boxHeaderTd=document.createElement("td"),boxContentTd=document.createElement("td"),boxFooterTd=document.createElement("td"),newHeaderDiv=document.createElement("div"),newContentDiv=document.createElement("div"),newFooterDiv=document.createElement("div"),allTds=document.getElementsByTagName("td");newHeaderDiv.id="hdiv_for_ie"; newContentDiv.id="cdiv_for_ie";newFooterDiv.id="fdiv_for_ie";for(i=0;i<allTds.length&&!found;i++)"edit_below_nav"==allTds[i].className&&(elementBefore=allTds[i],found=!0);boxHeaderTd.appendChild(newHeaderDiv);boxHeaderRow.appendChild(boxHeaderTd);boxHeaderRow.id="navi_shout_box_header";aNewTable.appendChild(boxHeaderRow);boxContentTd.appendChild(newContentDiv);boxContentRow.appendChild(boxContentTd);boxContentRow.id="navi_shout_box_content";aNewTable.appendChild(boxContentRow);boxFooterTd.appendChild(newFooterDiv); boxFooterRow.appendChild(boxFooterTd);aNewTable.appendChild(boxFooterRow);boxFooterRow.id="navi_shout_box_footer";aNewTable.id="navi_shout_box";elementBefore.insertBefore(aNewTable,elementBefore.firstChild);newHeaderDiv.innerHTML=boxHeaderContent;newContentDiv.innerHTML=boxContentContent;newFooterDiv.innerHTML=boxFooterContent;
</script>

Habs rot markiert.

mfg Philipp
______________
Forenregeln, FAQ, Suchfunktion
Beitrag02.01.2012 um 15:50 (UTC)    
Titel:

das gab jetzt nur einen Rahmen. Für Text ändern "Text" davor setzen ?
Beiträge der letzten Zeit anzeigen:   


Powered by phpBB © 2001, 2005 phpBB Group
Deutsche Übersetzung von phpBB.de