Código:
aqui mi duda <table align="center" width="540" border="0" class='tablenews'>
<!-- PRINCIPALES -->
<tr>
<td colspan="2">
<div id="newscontent">Lo Principal<br /><img src="./preload_3.gif" /></div>
</td>
</tr>
<tr>
<td colspan="2">
<!-- TEMAS -->
<div id="newsthemes" style="background:#FFFFCC; display:block">
<a href="#">tema 1</a><a href="#">tema 2</a><a href="#">tema 3</a>
</div>
<!-- fin:TEMAS -->
</td>
</tr>
<!-- fin:PRINCIPALES -->
<!-- ITEMS -->
<tr>
<td id="item1" style="padding: .2em; width: 270px; height: 60px; border: thin solid
silver; background:#FFFFFF"
onMouseover = "this.style.borderColor = '#efefef',this.style.backgroundColor='#EFEFEF'"
onMouseout = "this.style.borderColor = 'silver',this.style.backgroundColor='#FFFFFF'"> 1
</td>
<td id="item2" style="padding: .2em; width: 270px; height: 60px; border: thin solid
silver; background:#FFFFFF"
onMouseover = "this.style.borderColor = '#efefef',this.style.backgroundColor='#EFEFEF'"
onMouseout = "this.style.borderColor = 'silver',this.style.backgroundColor='#FFFFFF'"> 2
</td>
</tr>
<tr>
<td id="item3" style="padding: .2em; width: 270px; height: 60px; border: thin solid
silver; background:#FFFFFF"
onMouseover = "this.style.borderColor = '#efefef',this.style.backgroundColor='#EFEFEF'"
onMouseout = "this.style.borderColor = 'silver',this.style.backgroundColor='#FFFFFF'"> 3
</td>
<td id="item4" style="padding: .2em; width: 270px; height: 60px; border: thin solid
silver; background:#FFFFFF"
onMouseover = "this.style.borderColor = '#efefef',this.style.backgroundColor='#EFEFEF'"
onMouseout = "this.style.borderColor = 'silver',this.style.backgroundColor='#FFFFFF'"> 4
</tr>
<!-- fin:ITEMS -->
</table>
onclick = newinfo llamaria esta funcion, pero no se quien fue de las 4 opciones...
Código javascript:
Ver original
var maxchars = 100; var frases = new Array(); frases[0] = 'hola gatito. Este tema habla de este item, mas contenido lorem ipsum san dsfer fdc bdfgdvcxc'; frases[1] = 'hola perrito. Este tema habla de este item, mas contenido lorem ipsum san dsfer fdc bdfgdvcxc'; frases[2] = 'hola pajarito. Este tema habla de este item, mas contenido lorem ipsum san dsfer fdc bdfgdvcxc'; frases[3] = 'hola mundito. Este tema habla de este item, mas contenido lorem ipsum san dsfer fdc bdfgdvcxc'; function newsinfo() { alert ('desplegar informacion en '+maxchars) } for (i=1; i<5; i++) { contenido = frases[i-1]; itemcont = (contenido.length>maxchars) ? contenido.substring(0,maxchars) : contenido; itemcont += '<br /><div style="text-align:right"><a href="#">leer más >></a></div>' document.getElementById('item'+i).innerHTML = 'DATE , item'+i+ ': ' + itemcont; document.getElementById('item'+i).onclick = newsinfo; }

