The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Simple javascript help
HELP!
Im trying to change a simple image rollover script so that it displays code rather than a new image. For example: Before roll over: image1.jpg After roll over <h1><img src="image2.jpg" />Test</h1> Is this possible? Regards, James --------------- Added [DATE]1202850179[/DATE] at [TIME]1202850179[/TIME] --------------- This is what i have been trying to convert to replace an image with code, but the src function is tied into it and i cant get it to work. http://joemaller.com/js-singleroll.shtml |
#2
|
||||
|
||||
Well that code is very specifically about swapping images in and out on a roll-over, which is not what you want to do. What you'll need to do is wrap your IMG tag in a div, then set the innerHTML property as you roll in and out.
So the div would look something like this: HTML Code:
<div id="myimage"><img src="image2.jpg"></div> Then in your mouseOver function, just do something like this: Code:
document.getElementById('myimage').innerHTML = '<img src="image2.jpg"><h1>Test</h1>'; Code:
document.getElementById('myimage').innerHTML = '<img src="image2.jpg">'; |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|