1. I'm using the following script to change the 1st picture to the 2nd while the moues is on the 1st one and change back to the 1st one when its off the 2nd one.(its just for a div!)
pretty easy, I think i complicated my explanation...
mouse off - picture 1.
mouse on - picture 2.
mouse off - picture 1.
<script>
<!--
if (document.images)
{check = true;}
else
{check = false;}
if (check == true){
image23= new Image();
image23.src = (image, cant post it);
image23over = new Image();
image23over.src = (image, cant post it);
// There were more images, but I couldn't post them, so I deleted
// them and left this one as an example.
}
function over(name) {
if (check == true){ document[name].src = eval(name + "over.src"); }}
function off(name) {
if (check == true){ document[name].src = eval(name + ".src");}}
//-->
</script>
And I call it like that: (in the body)
<(link, cant post it...) onmouseout="off('image23')" onmouseover="over('image23')">
<img name="image23" src="1off.jpg" border="0"></a>
// There were more images, but I couldn't post them, so I deleted
// them and left this one as an example.
Its important to remember that those are inside a div, so I gota use that compliacted script to do that simple thing.Now, the problem:
When I load the page, all of the imges are [X]s and when I put my mouse over them, they become fine. But, I want the pictures to be like they are supposed to be from the beggining.
Any suggestions?
2. I have a clock in my site. I managed to call it only by using a form tag. I dont really care if I call it with a form tag though. But, I do care that the numbers, and characters would be centered, in a white font in the form and the form border, and background would be black. Now, I dont really know if a form tag can be manipulated to do that, so if it can't, does any one have any idea of calling the clock function in a method that would center and display in a white font the numbers and characters where i want them to be, and display them on a black background?
The clock script is:
<!-- Hide the script from old browsers --
var timerID = null;
var timerRunning = false;
var id,pause=0,position=0;
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function showtime () {
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds()
var timeValue = "" + ((hours >12) ? hours -12 :hours)
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " P.M." : " A.M."
document.clock.face.value = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
function startclock () {
stopclock();
showtime();
}
// --End Hiding Here -->
</script>
And I call it like that:<BODY onload="startclock()"> <form name="clock" onSubmit="0"> <input type="text" name="face" size="23" value=""> </form>Thanks in advanced.
Edited by Mers, 18 June 2009 - 02:43 PM.
Some mispellings


Sign In
Create Account


Back to top









