View Full Version : Rollover Help!!!
MrChaz
12-08-2006, 02:45 AM
Ok i use iframes, and i have some links, when i click them, the page opens beside them in the iframe (odviously).
However, i want to make these links, rollover images, but when i click them, i want the rollover image to stay, if you know what i mean?
Thanks to whoever helps me, you guys are all lifesavers.
:) :)
BonRouge
12-08-2006, 04:33 AM
I wouldn't recommend using iframes, but you could do it like this: http://bonrouge.com/demos/current_iframe.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<title>Show current with iframe</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
* {
margin:0;
padding:0;
}
body {
background-color:white;
}
#menu {
float:left;
margin:20px;
}
a:link, a:visited {
color:navy;
}
a:hover {
color:white;
background:red;
}
a:active {
color:gray;
}
a.current {
color:white;
background:navy;
}
iframe {
width:800px;
height:500px;
}
</style>
<script type="text/javascript">
function current(menu) {
var atags=document.getElementById(menu).getElementsByTagName('a');
for (i=0; i<atags.length; i++) {
atags[i].onclick=function() {
for (j=0; j<atags.length; j++) {
atags[j].className=atags[j].className.replace(new RegExp("current\\b"), "");
}
this.className+=" current";
}
}
}
window.onload=function() {current('menu')}
</script>
</head>
<body>
<ul id="menu">
<li><a href="http://google.com" target="theiframe">Google</a></li>
<li><a href="http://bonrouge.com" target="theiframe">bonrouge</a></li>
<li><a href="http://php.net" target="theiframe">php manual</a></li>
</ul>
<iframe name="theiframe"></iframe>
</body>
</html>
MrChaz
12-08-2006, 04:45 AM
Dude, iframes own...
BonRouge
12-08-2006, 04:46 AM
Dude, iframes own...
Does that mean 'thank you'?
MrChaz
12-08-2006, 10:17 PM
Thank you for trying but it still doesnt work, my Rollover links will be Images, if you know what it means.
BonRouge
12-09-2006, 02:48 AM
The same thing applies. Use background images for the rollover links and use the .current class to show the image you use for the current iframe content. You just use an image instead of changing the colour. It's the same thing.
MrChaz
12-09-2006, 03:46 PM
Can you give me an example code?
BTW THANK YOU SOOO MUCH FOR YOUR HELP!
+Rep <3
BonRouge
12-09-2006, 03:50 PM
I thought I did that already. :confused:
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.