Pedido: Codigo HTML Transicion de imagen

Cerrado
Master-G - 9 mar 2010 a las 18:27
tupadrecape Mensajes enviados 45 Fecha de inscripción viernes, 30 de abril de 2010 Estatus Miembro Última intervención sábado, 7 de abril de 2012 - 1 may 2010 a las 18:37
Hola, yo tengo un ipod touch, al que quiero ponerle que en el lockscreen cambie la img segun amanecer/dia/noche... todo esto se hace con codigos html. Poseo uno que cambia la imagen cada cierto periodo (4seg c/u), pero lo que quiero es que por ejemplo:

>A las 8am: muestre una imagen (amanecer)
>A las 12am: que cambie a la otra (dia)
>A las 8pm: que cambie a la ultima (noche)
>Y este mismo proceso seguidamente...

Por mas que busco por todos lados no puedo encontrar nada, asi que decidi hacer mi propio post...

Si me pueden ayudar se los agradeceria eternamente :D :D

Si quieren les dejo el codigo que uso para q lo adapten a ese....

<?xml version="1.0" encoding="UTF-16"?>
<html><head>
    <base href="Private/">
    <!--meta name="viewport" content="width=320, minimum-scale=1.0, maximum-scale=1.0"/-->
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>


	

	
	
	<noscript>
<!--
    We have the "refresh" meta-tag in case the user's browser does
    not correctly support JavaScript or has JavaScript disabled.

    Notice that this is nested within a "noscript" block.
-->
<meta http-equiv="refresh" content="60">

</noscript>

<script language="JavaScript">
<!--

var sURL = unescape(window.location.pathname);

function doLoad()
{
    // the timeout value should be the same as in the "refresh" meta-tag
    setTimeout( "refresh()", 60*1000 );
}

function refresh()
{
    //  This version of the refresh function will cause a new
    //  entry in the visitor's history.  It is provided for
    //  those browsers that only support JavaScript 1.0.
    //
    window.location.href = sURL;
}
//-->
</script>

<script language="JavaScript1.1">
<!--
function refresh()
{
    //  This version does NOT cause an entry in the browser's
    //  page view history.  Most browsers will always retrieve
    //  the document from the web-server whether it is already
    //  in the browsers page-cache or not.
    //  
    window.location.replace( sURL );
}
//-->
</script>

<script language="JavaScript1.2">
<!--
function refresh()
{
    //  This version of the refresh function will be invoked
    //  for browsers that support JavaScript version 1.2
    //
    
    //  The argument to the location.reload function determines
    //  if the browser should retrieve the document from the
    //  web-server.  In our example all we need to do is cause
    //  the JavaScript block in the document body to be
    //  re-evaluated.  If we needed to pull the document from
    //  the web-server again (such as where the document contents
    //  change dynamically) we would pass the argument as 'true'.
    //  
    window.location.reload( false );
}
//-->
</script>
</head>

<!--
    Use the "onload" event to start the refresh process.
-->
	


	
	
	
    <style>
        body {
            background-color: black;
            margin: 0;
            padding: 20px 0 0 0;
            height: 480px;
            width: 320px;
        }

        img {
            -webkit-transition-property: opacity;
            -webkit-transition-duration: 2s;
            position: absolute;
            width: 320px;
            height: auto;
        }

        img.fade-out {
            opacity: 0;
        }

        img.fade-in {
            opacity: 1;
        }
    </style>
	<script language="JavaScript">
	
day=new Date()     //..get the date

x=day.getHours()    //..get the hour

if(x>=20 && x<7) {

   document.write('<style type="text/css">body{background: "m.png"; color: black}"></style>')

} else


if(x>=7 && x<12) {

   document.write('<style type="text/css">body{background: "h.png"; color: black}"></style>')

} else


if(x>=12 && x<20) {

   document.write('<style type="text/css">body{background: "s.png"; color: black}</style>')
   
}

</script>











 
</head><body style="color: black" onload="doLoad()">


</body></html>
Consulta también:

1 respuesta

tupadrecape Mensajes enviados 45 Fecha de inscripción viernes, 30 de abril de 2010 Estatus Miembro Última intervención sábado, 7 de abril de 2012 33
1 may 2010 a las 18:37
SERIA MEJOR EN PHP, CAPTURAS LA HORA DEL SERVIDOR CON ESTE SCRIPT
$hora = strftime( "%H", time() ); LA COMPARAS Y SEGUN EL DATO CAMBIAS EL SRC DE LA IMAGEN, LISTO
0