Ok, so I have a couple of questions/problems:
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.
And I call it like that: (in the body)Code:<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>
Its important to remember that those are inside a div, so I gota use that compliacted script to do that simple thing.Code:<(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.
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:
And I call it like that:Code:<!-- 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>
Thanks in advanced.Code:<BODY onload="startclock()"> <form name="clock" onSubmit="0"> <input type="text" name="face" size="23" value=""> </form>
Last edited by Mers; 06-18-2009 at 03:43 PM. Reason: Some mispellings
1. I'm not sure I understand your problem but is "1off.jpg" actually an image you have stored on your server? This is the one that should appear when you load the page, before any mouse event can get fired.
haha solved my problem man! thanks. Any ideas about the second one?
Glad I could helpI know there is a majority of men on here but check again my username
As for your second problem, I don't think you can use the textAlign property on an input field so you couldn't center the text in an input form. I'm actually rather puzzled as to why you are using an input field to show the clock, it doesn't seem fit for purpose.
You could display the clock in a div block element, which you could style as you want it with document.getElementById("myDiv").style.color/textAlign/backgroundColor and you could call it by a mouseover() event over the div element for example, or call it with an onload() event on the body.
How exactly do I do that? I'm not really a pro in javascript...
Well, I found a code somewhere... With a java applet lol... But, it works so who cares?
java applet is different and the user needs to have the java runtime files installed, not like javascript.. so it will not work for those who do not have java installed
Most of the people have a java ruintime files installed... I mean, you know java is very popular so most of the computers in the world have it, right?
Do you have any idea with javascript?
Hmmm, I thought about it, but I dont think form tags can be manipulated like that... That's also what NatalieM said.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks