Nejste přihlášeni
Stránky 1
Zdravim,
mam tabulku, kde se mi pomoci vlozeneho javascriptu zmeni barva oznaceneho radku. Potreboval bych, aby se mi zmenila jeste barva textu v oznacenem radku.
tady je kod scriptu a zacatek tabulky:
<!-- Row Highlight Javascript -->
<script type="text/javascript">
window.onload=function(){
var tfrow = document.getElementById('tfhover').rows.length;
var tbRow=[];
for (var i=1;i<tfrow;i++) {
tbRow[i]=document.getElementById('tfhover').rows[i];
tbRow[i].onmouseover = function(){
this.style.backgroundColor = '#ff0000';
};
tbRow[i].onmouseout = function() {
this.style.backgroundColor = '#2f2f2f';
};
}
};
</script>
<style type="text/css" >
table.tftable {font-size:12px;color:#fbfbfb;border-width: 1px;border-color: #686767;border-collapse: collapse;}
table.tftable th {font-size:11px;font-family:Verdana,Arial,Sans-Serif;color:#ffff00;background-color:#171515;border-width: 1px;padding: 5px;border-style: solid;border-color: #686767;text-align:center;}
table.tftable tr {background-color:#2f2f2f;text-align:center;}
table.tftable td {font-size:11px;font-family:Verdana,Arial,Sans-Serif;border-width: 1px;padding: 4px;border-style: solid;border-color: #686767;text-align:center;}
</style>
<table id="tfhover" class="tftable" border="1">
<tr><th width="70" >Hráč</th><th width="60" >Zápasů</th><th width="60" >Hr84</th><th width="60" >Header</th><th width="60" >Header</th><th width="60" >Header</th><th width="60" >Header</th><th width="60" >Header</th><th width="60" >Header</th><th width="60" >Header</th><th width="60" >Header</th><th width="60" >Header</th></tr>
<tr><td ><a rel="nofollow" href="http://maps.google.cz/maps?hl=cs&tab=ll" class="zlutyodkaz" target="_blank">Nadpis</a></td><td>35 : 13</td><td>Rl:3</td><td>R:4</td><td>Rl:5</td><td>Rol:5</td><td >35:15</td><td></td><td>Rl:3</td><td>R:4</td><td>Rl:5</td><td>Rol:5</td></tr>
<tr><td>35:15</td><td>35:15</td><td>Rl:3</td><td></td><td>Ro:5</td><td>Rol:5</td><td >35:15</td><td></td><td>Rl:3</td><td>R:4</td><td>Rl:5</td><td>Rol:5</td></tr>
<tr><td>35:15</td><td>35:15</td><td>l:3</td><td></td><td>Rll:5</td><td>Ro:5</td><td >35:15</td><td></
</table>
Zkousel jsem pridat radek:
this.style.font = '#ffff00'; ale nepomohlo..
Moc dekuju za pomoc
Offline
kdyuž tak this.style.color
takže
<!-- Row Highlight Javascript -->
<script type="text/javascript">
window.onload=function(){
var tfrow = document.getElementById('tfhover').rows.length;
var tbRow=[];
for (var i=1;i<tfrow;i++) {
tbRow[i]=document.getElementById('tfhover').rows[i];
tbRow[i].onmouseover = function(){
this.style.backgroundColor = '#ff0000';
this.style.color = '#ffff00';
};
tbRow[i].onmouseout = function() {
this.style.backgroundColor = '#2f2f2f';
this.style.color = '#fff';
};
}
};
</script>
<style type="text/css" >
table.tftable {font-size:12px;color:#fbfbfb;border-width: 1px;border-color: #686767;border-collapse: collapse;}
table.tftable th {font-size:11px;font-family:Verdana,Arial,Sans-Serif;color:#ffff00;background-color:#171515;border-width: 1px;padding: 5px;border-style: solid;border-color: #686767;text-align:center;}
table.tftable tr {background-color:#2f2f2f;text-align:center;}
table.tftable td {font-size:11px;font-family:Verdana,Arial,Sans-Serif;border-width: 1px;padding: 4px;border-style: solid;border-color: #686767;text-align:center;}
</style>
<table id="tfhover" class="tftable" border="1">
<tr><th width="70" >Hráč</th><th width="60" >Zápasů</th><th width="60" >Hr84</th><th width="60" >Header</th><th width="60" >Header</th><th width="60" >Header</th><th width="60" >Header</th><th width="60" >Header</th><th width="60" >Header</th><th width="60" >Header</th><th width="60" >Header</th><th width="60" >Header</th></tr>
<tr><td ><a rel="nofollow" href="http://maps.google.cz/maps?hl=cs&tab=ll" class="zlutyodkaz" target="_blank">Nadpis</a></td><td>35 : 13</td><td>Rl:3</td><td>R:4</td><td>Rl:5</td><td>Rol:5</td><td >35:15</td><td></td><td>Rl:3</td><td>R:4</td><td>Rl:5</td><td>Rol:5</td></tr>
<tr><td>35:15</td><td>35:15</td><td>Rl:3</td><td></td><td>Ro:5</td><td>Rol:5</td><td >35:15</td><td></td><td>Rl:3</td><td>R:4</td><td>Rl:5</td><td>Rol:5</td></tr>
<tr><td>35:15</td><td>35:15</td><td>l:3</td><td></td><td>Rll:5</td><td>Ro:5</td><td >35:15</td><td></
</table>
W3C validator | Performance tools | Stavové kódy HTTP | Fiddle | Codepen | Ideone | XAMPP
Offline
No dobre, pridal jsem this.style.color = '#ffff00'; a barva textu se po oznaceni opravdu zmenila, ale uz takova zustala stale. Tedy nevratila se na puvodni barvu po odznaceni.. jiny napad? Diky
Offline
dopsal jsem do prveho prispevku cely kod
W3C validator | Performance tools | Stavové kódy HTTP | Fiddle | Codepen | Ideone | XAMPP
Offline
Zkoušel jste použít
this.style.fontColor = '#fff000'
1. Murphyho zákon:
Na počátku nebylo nic. I to se pokazilo!
stránky: CMS test
kontakt - instalace systémů, MySQL, FTP přístup, ...
Instalační balíky vybraných CSM
Problémy spojené s provozem služeb Endora, řešte na tomto fóru.
Offline
Super, diky moc !
Offline
Stránky 1