Ver Mensaje Individual
  #2 (permalink)  
Antiguo 03/05/2012, 09:53
chinanzio
 
Fecha de Ingreso: marzo-2007
Mensajes: 82
Antigüedad: 17 años, 2 meses
Puntos: 21
Respuesta: cambiar Background de mi web

para la pregunta 1
algo asi te sirve ?

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  4. <title>Insert title here</title>
  5. <script src="http://code.jquery.com/jquery-1.7.1.js" type="text/javascript" ></script>
  6.  
  7.     body {
  8.         margin: 0;
  9.         padding: 0;
  10.     }
  11.    
  12.     div#bg-1 {
  13.         position: absolute;
  14.         width: 100%;
  15.         height: 100%;
  16.         background-image: url('http://static2.grsites.com/archive/textures/dgren/dgren002.jpg');
  17.     }
  18.  
  19.     div#bg-2 {
  20.         position: absolute;
  21.         width: 100%;
  22.         height: 100%;
  23.         background-image: url('http://static3.grsites.com/archive/textures/blue/blue003.jpg');
  24.         display: none;
  25.     }
  26.    
  27.     div#bg-3 {
  28.         position: absolute;
  29.         width: 100%;
  30.         height: 100%;
  31.         background-image: url('http://static3.grsites.com/archive/textures/brown/brown007.jpg');
  32.         display: none;
  33.     }
  34.  
  35. <script type="text/javascript">
  36. var divIds = ["bg-1", "bg-2", "bg-3"];
  37. var currentIndex = 0;
  38. function changeBackground(country) {
  39.     var outDivId = divIds[currentIndex];
  40.     currentIndex = (currentIndex + 1 ) % divIds.length;
  41.     var inDivId = divIds[currentIndex];
  42.  
  43.     var outDiv = document.getElementById(outDivId);
  44.     var inDiv = document.getElementById(inDivId);
  45.     $(outDiv).fadeOut("slow");
  46.     $(inDiv).fadeIn("slow");
  47.  
  48.     setTimeout(changeBackground, 3000);
  49. }
  50.  
  51. setTimeout(changeBackground, 3000);
  52. </head>
  53.     <div id="bg-1"></div>
  54.     <div id="bg-2"></div>
  55.     <div id="bg-3"></div>
  56. </body>
  57. </html>
__________________
Hazle un favor a tu cerebro y juega Ajedrez online
Chess online