View Full Version : sorry...i have a question...


sm00
07-04-2003, 03:11 PM
hihi...

i totally new to html and have only started learnig them 2 days ago...

can i make a image change to a text...and its not a button...or is it impossible to do it???

please help me...thanx!!!


-sm00-

dandeman2k
07-04-2003, 05:01 PM
OK, let me make sure i understand you, you want to have an image and then you want that to disapear and text to show in its place?

If that is what you want to do then this is the script you need.

inside the head tags place the following script:

<script language="JavaScript" type="text/javascript">
<!--

var textshowing = "yes"


function swap(){
if (textshowing == "no"){
document.all.image.style.visibility = "hidden"
document.all.text.style.visibility = "visible"
textshowing = "yes"
}
else {
document.all.image.style.visibility = "visible"
document.all.text.style.visibility = "hidden"
textshowing = "no"

}
}
function hidetext(){
document.all.text.style.visibility = "hidden"
textshowing = "no"
}

var whateva = setTimeout("swap()",1000)
//the line above this is the line you edit

//-->
</script>

Can you see the line "var whateva = setTimeout("swap()",1000)", You can change the number here to the number of seconds you want it to wait after the page has loaded multiplied by 1000

now instead of having your <body> tag like that replace that with this:

<body onLoad="hidetext()">


now comes the part inside the body with your picture and text. Insert the following lines of code replacing the text (which is "^^^^ yeah") with your text and the pictures src to your pictures src (do you understand, im sorry if im using too much jargon):


<span ID= "image">
<img src="yourimage.gif" alt="ha ha">
</span>
<span ID= "text">
^^^^ yeah
</span>


I hope this helps you and wasn't to complicated to follow. If you have any questions just reply to this post.

sm00
07-10-2003, 01:36 PM
sorry...
i think you have misunderstood me...or maybe i was unclear...

i want to make an image which will become a text when the mouse is placed over...and can it not be a button...and is it possible to add sound???

thanx!


-sm00-