Ver Mensaje Individual
  #6 (permalink)  
Antiguo 06/09/2010, 14:54
kseso?
Colaborador
 
Fecha de Ingreso: junio-2007
Mensajes: 5.798
Antigüedad: 16 años, 10 meses
Puntos: 539
Respuesta: Imagen de sustitución.

Supongo que el uso del jQuery no será sólo para ese efecto de sustitución visual de un elemento por otro al /:hover/ y para el desvanecimiento de la transición. Sería como matar moscas a cañonazos.

Ya que la consulta se hace en un foro de css, ya le digo que eso mismo (y con matizaciones también la transición) sería más eficiente lograrlo sólo con css.
A priori, sin intento de lograrlo, no necesitaría más que añadir al selector de esa página
Cita:
.list1 li a:hover img {visibility: hidden;}
Bueno, al final, aquí tiene el código. Respetando el marcado html y el css, con esa línea añadida.
NOTA: sólo a efectos lectivos y como explicación se hace uso del html y css de esa página: All rights reserved © 2009 The Css Website Awards :: CSS Gallery of the most prestigious websites.

Copie, pegue, ejecute en el navegador. Pero lo más importante, estudie el código y vea qué hace qué. Y no olvide el copyright
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" lang="es-es">
  3. <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  4. <title>Kseso? Jugando con css</title>
  5. <style type="text/css">
  6.  * {
  7.     margin: 0;
  8.     padding: 0;
  9.     border: 0;
  10.     outline: 0;
  11.   }
  12. html, body {
  13.   font-weight:normal;
  14.     font-size: 100%;
  15.     height:100%;
  16.     width:100%;
  17.   }
  18. ul {
  19. list-style-type:none;
  20. }
  21. .list1 li.dia {
  22. background:none repeat scroll 0 0 #96BC43;
  23. color:#333333;
  24. }
  25. .list1 li {
  26. float:left;
  27. height:101px;
  28. margin:0 6px 6px 0;
  29. padding:0;
  30. position:relative;
  31. width:171px;
  32. }
  33. .list1 li a {
  34. height:101px;
  35. left:0;
  36. margin:0;
  37. padding:0;
  38. position:absolute;
  39. top:0;
  40. width:171px;
  41. z-index:3;
  42. }
  43. .list1 li.dia a img {
  44. left:0;
  45. margin:0;
  46. padding:0;
  47. position:absolute;
  48. top:0;
  49. z-index:3;
  50. }
  51. a {
  52. color:#9BB725;
  53. text-decoration:none;
  54. }
  55. .list1 li a:hover img {visibility: hidden;}
  56. .list1 li div.txt {
  57. height:101px;
  58. width:171px;
  59. z-index:1;
  60. }
  61. .list1 li div.txt {
  62. height:101px;
  63. width:171px;
  64. z-index:1;
  65. }
  66. .list1 li div.txt span.dia {
  67. font-family:"Trebuchet MS",Arial,Helvetica,sans-serif;
  68. font-size:33px;
  69. left:19px;
  70. position:absolute;
  71. text-align:right;
  72. top:12px;
  73. width:34px;
  74. }
  75. .list1 li div.txt span.mes {
  76. font-family:"Trebuchet MS",Arial,Helvetica,sans-serif;
  77. font-size:13px;
  78. font-weight:bold;
  79. left:55px;
  80. position:absolute;
  81. text-transform:uppercase;
  82. top:17px;
  83. }
  84. .list1 li div.txt span.ano {
  85. font-family:"Trebuchet MS",Arial,Helvetica,sans-serif;
  86. font-size:11px;
  87. font-weight:bold;
  88. left:55px;
  89. position:absolute;
  90. top:31px;
  91. }
  92. .list1 li div.txt span.tit {
  93. color: #fff;
  94. font-family:Arial,Helvetica,sans-serif;
  95. font-size:13px;
  96. font-weight:700;
  97. left:19px;
  98. position:absolute;
  99. top:46px;
  100. }
  101. .list1 li div.txt span.nota {
  102. font-size:33px;
  103. left:15px;
  104. position:absolute;
  105. text-align:right;
  106. top:60px;
  107. width:22px;
  108. }
  109. .list1 li div.txt span.dec {
  110. font-size:13px;
  111. font-weight:bold;
  112. left:40px;
  113. position:absolute;
  114. top:63px;
  115. }
  116.  
  117. </head>
  118. <ul class="list1">
  119.  
  120. <li class="dia">
  121. <a href="http://www.thecssawards.com/no-favorite.html"><img alt="css web" src="http://www.thecssawards.com/webimages/1283242122.jpg" /></a>
  122. <div class="txt">
  123. <span class="dia">06</span>
  124. <span class="mes">Sep</span>
  125. <span class="ano">2010</span>
  126. <span class="tit">WEBSITE OF THE DAY</span>
  127. <span class="nota">7</span>
  128. <span class="dec">23</span>
  129. </div>
  130. </li>
  131. <li class="dia">
  132. <a href="http://www.thecssawards.com/made-by-tj.html"><img alt="css web" src="http://www.thecssawards.com/webimages/1282596076.png" /></a>
  133. <div class="txt">
  134. <span class="dia">05</span>
  135. <span class="mes">Sep</span>
  136. <span class="ano">2010</span>
  137. <span class="tit">WEBSITE OF THE DAY</span>
  138. <span class="nota">6</span>
  139. <span class="dec">66</span>
  140. </div>
  141. </li>
  142. <li class="dia">
  143. <a href="http://www.thecssawards.com/johnnybroccolii.html"><img alt="css web" src="http://www.thecssawards.com/webimages/1282549227.png" /></a>
  144. <div class="txt">
  145. <span class="dia">04</span>
  146. <span class="mes">Sep</span>
  147. <span class="ano">2010</span>
  148. <span class="tit">WEBSITE OF THE DAY</span>
  149. <span class="nota">6</span>
  150. <span class="dec">95</span>
  151. </div>
  152. </li>
  153. <li class="dia">
  154. <a href="http://www.thecssawards.com/ines-papert.html"><img alt="css web" src="http://www.thecssawards.com/webimages/1283168669.jpg" /></a>
  155. <div class="txt">
  156. <span class="dia">03</span>
  157. <span class="mes">Sep</span>
  158. <span class="ano">2010</span>
  159. <span class="tit">WEBSITE OF THE DAY</span>
  160. <span class="nota">7</span>
  161. <span class="dec">03</span>
  162. </div>
  163. </li>
  164. </ul>
  165. </body>
  166. </html>

Última edición por kseso?; 06/09/2010 a las 15:02