acslater323
03-01-2006, 11:48 PM
Okay, I don't think you can do THIS with CSS, but we'll see..
I have a series of images that when rolled over display a block of text in a div located on another part of the page. So I have a function set up that gets the text passed through it to the innerHTML... i.e:
<script>
function rollover(text) {
getElementById('info').innerHTML=text;
}
</script>
<html>
img onMouseOver="rollover('this is image one')"
</html>
The problem is, this confines me to very limited text formatting. I'd like to do some styling with CSS but Javascript won't let you start throwing span tags in the parentheses, and even if it did, it's bloated code that no one wants to deal with.
So how do you pass text through a function without losing the formatting?
-Aaron
I have a series of images that when rolled over display a block of text in a div located on another part of the page. So I have a function set up that gets the text passed through it to the innerHTML... i.e:
<script>
function rollover(text) {
getElementById('info').innerHTML=text;
}
</script>
<html>
img onMouseOver="rollover('this is image one')"
</html>
The problem is, this confines me to very limited text formatting. I'd like to do some styling with CSS but Javascript won't let you start throwing span tags in the parentheses, and even if it did, it's bloated code that no one wants to deal with.
So how do you pass text through a function without losing the formatting?
-Aaron