Publicentral.com - publicentra, promocion, promocionar, buscadores, paginas webs, registroPublicentral.com - promocion de paginas web y negocios online
Mostrando Codigo - Asp
Code

Asp - Coloreando tablas

Códigos Asp

Con este script resaltaremos las tablas con colores, dando a la vez un efecto de luz.
Visitas: 11,825 - 15/04/2003
DemoNO CONTIENE ARCHIVO DESCARGABLEComentario
EXPLICACION
Const sPrimaryColor = "WHITE"
Const sSecondaryColor = "YELLOW"
Las constantes de los colores
CODIGO
Codigo probado en ChromeCodigo probado en Mozilla FirefoxCodigo probado en Internet Explorer 7+Codigo probado en OperaCodigo probado en Safari


<% 'Codigo ofrecido por Tutores.org %>

  1. <%
  2.         'Constantes para los colores
  3.         Const sPrimaryColor = "WHITE"
  4.         Const sSecondaryColor = "YELLOW"
  5.         Dim bColorFlag
  6.         Dim lCounter
  7.         'Ahora hacemos el trabajo
  8.         function LineColor()
  9.             bColorFlag = Not bColorFlag
  10.             if bColorFlag Then
  11.                 LineColor = sPrimaryColor
  12.             Else
  13.                 LineColor = sSecondaryColor
  14.             End if
  15.         End function
  16.     %>
  17.     <SCRIPT language='VBScript'>
  18.         Dim sRowOldColor
  19.         Const sHighlightColor = "LIGHTBLUE"
  20.        
  21.         Sub Document_onclick()
  22.            
  23.             Dim sID
  24.            
  25.            
  26.             if Window.Event.srcElement.tagName = "TD" Then
  27.                 sID = Window.Event.srcElement.ParentElement.id
  28.                 MsgBox "ID = " & sID,,"This is the ID of the row."
  29.             End if     
  30.         End Sub
  31.         Sub Document_onmouseover()
  32.             if Window.Event.srcElement.tagName = "TD" Then
  33.                 sRowOldColor = window.event.srcElement.ParentElement.bgcolor
  34.                 window.event.SrcElement.ParentElement.bgcolor=sHighlightColor
  35.             End if
  36.         End Sub
  37.        
  38.         Sub Document_onmouseout ()
  39.             if window.event.srcElement.tagName = "TD" Then
  40.                 window.event.srcElement.parentElement.bgcolor = sRowOldColor
  41.             End if
  42.         End Sub
  43.     </SCRIPT>
  44.     <HTML>
  45.         <HEAD>
  46.             <TITLE>
  47.                 Alternando colores - Tutores.org
  48.             </TITLE>
  49.         </HEAD>
  50.         <BODY>
  51.             <CENTER>
  52.                 <P>
  53.                     <BR>
  54.                 </P>
  55.                 <TABLE width='80%' cellspacing='3' cellpadding='3' border='1'>
  56.                 <%
  57.                     For lCounter = 1 To 10
  58.                         Response.Write("<TR bgcolor='" & LineColor & "' id='" & lCounter & "'>" & vbCrLf)
  59.                         Response.Write("<TD><CENTER>" & lCounter & "</CENTER></TD>" & vbCrLf)
  60.                         Response.Write("</TR>" & vbCrLf)
  61.                     Next
  62.                 %>
  63.                 </TABLE>
  64.             </CENTER>
  65.         </BODY>
  66.     </HTML>
  67.  
  68.  



ENLACE AL CODIGO
Si quieres enlazar desde tu pagina a este codigo
<!-- Inicio enlace Tutores.org -->
<a title="Tutores.org - Coloreando tablas" href="http://www.tutores.org/codigo/105/" target="_blank">Coloreando tablas</a>
<!-- Final enlace Tutores.org -->
COMENTARIOS
Aun no existe ningun comentario para este Codigo.
INSERTAR COMENTARIO

Usuario:
Email:
Comentario:
Codigo Seguridad


Antes de enviar un comentario...
Todos los comentarios son revisados personalmente
Todo comentario que no haga relacion al codigo mostrado en esta pagina sera eliminado

Usuarios registrados tienen preferencia en recibir respuestas de ayuda!!
Ademas de poder insertar Imagenes,Enlaces y otras propiedades del editor.
Por favor, insertar los comentarios descriptivos.