Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.
Thread: Wallpaper.html help
is a discussion within theSkinning / Themes Discussion
forums, a part of theDesign and Media For the iPhone / iPod Touch
section;alright, yesterday i started to learn how to code in html, css, and javascript and whatnot with tutorials and looking at different examples, so i thought i might try to
...-
09-03-2011, 07:01 PM #1
Wallpaper.html help
alright, yesterday i started to learn how to code in html, css, and javascript and whatnot with tutorials and looking at different examples, so i thought i might try to make a Wallpaper.html to display the time in hours minutes and seconds. this is what i came up with... it works fine on the homescreen but when i used the same code for the LockBackground.html it starts to screw up. its hard to explain but its like the the numbers start to overlay each other, like when the minutes go from 12 to 13 they show overtop each other...
heres the code
<html>
<head>
<script type="text/javascript">
function startTime()
{
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
m=checkTime(m);
s=checkTime(s);
h=checkHours(h);
document.getElementById('txt').innerHTML=h+":"+m+" :"+s;
t=setTimeout('startTime()',500);
}
function checkTime(i)
{
if (i<10)
{
i="0" + i;
}
return i;
}
function checkHours(e)
{
if (e>12)
{
e=e - 12
}
return e;
}
</script>
</head>
<body onload="startTime()">
<div id="txt" style="color:blue;font-size:50px;font-family:helvetica"></div>
</body>
</html>




LinkBack URL
About LinkBacks
Reply With Quote