PDA

View Full Version : CSS rollover visibility menu nav issues...


mlg5454
04-16-2008, 01:52 AM
What I thought was a great idea originally may not be achievable via CSS...

http://www.theartshole.com/stuff/

I want each letter of A-R-T-S-H-O-L-E to correspond to other images. For example, the A, when the mouse is over it, should reveal the "ARTISTS" image. But now I realize it may not be possible.

What IS possible, however, is hiding ARTISTS or z-indexing it so that when it is hovered over it's revealed, but I wanted only the A of ARTSHOLE to do that. Any suggestions?

Max

rangana
04-16-2008, 03:14 AM
For example, the A, when the mouse is over it, should reveal the "ARTISTS" image. But now I realize it may not be possible.
Max

Maybe it's possible, see this code:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
html,body {
margin:0;
padding:0;
height:100%;
}
#container{width:600px;border:3px double #222;margin:20px auto;height:500px;text-align:center;}
span{padding:10px;cursor:pointer;}
#show{width:500px; margin:10px auto;border:1px solid #999;height:200px;padding:10px;font-family:Tahoma;}
#show img{border:1px solid #00f;padding:5px;}
</style>
<script type="text/javascript">
window.onload = function()
{
var a=document.getElementById('a');
var r=document.getElementById('r');
var t=document.getElementById('t');
var s=document.getElementById('s');
var h=document.getElementById('h');
var o=document.getElementById('o');
var l=document.getElementById('l');
var e=document.getElementById('e');
var show = document.getElementById('show');
a.onclick = function()
{
show.innerHTML ='<img src="http://tbn0.google.com/images?q=tbn:viGj4CFryp73JM:http://blog.seattlepi.nwsource"><br/><br/>Arts Image';
}
r.onclick = function()
{
show.innerHTML ='<img src="http://tbn0.google.com/images?q=tbn:phcxSOfWf1wOxM:http://lh3.google.com/_LLUdp7YIK2A"><br/><br/>"R" Image';
}
t.onclick = function()
{
show.innerHTML ='<img src="http://tbn0.google.com/images?q=tbn:dwCa2dB1WpVmOM:http://www.wallables.com"><br/><br/>"T" Image';
}
s.onclick = function()
{
show.innerHTML ='<img src="http://tbn0.google.com/images?q=tbn:Jcoil0bgIwRjuM:http://www.printactivities.com/Mazes/LetterMazes/Letter_s_Small.gif"><br/><br/>"S" Image';
}
h.onclick = function()
{
show.innerHTML ='<img src="http://tbn0.google.com/images?q=tbn:QNk65o2ZARH3tM:http://home.iae.nl/users/"><br/><br/>"H" Image';
}
o.onclick = function()
{
show.innerHTML ='<img src="http://tbn0.google.com/images?q=tbn:ouYFJKzq31jVcM:http://www.pewterkingdom.com/LastingExpressions/LetterO.jpg"><br/><br/>"O" Image';
}
l.onclick = function()
{
show.innerHTML ='<img src="http://tbn0.google.com/images?q=tbn:RvJeWtGLo2ZrRM:http://z.about.com/d/deafness"><br/><br/>"L" Image';
}
e.onclick = function()
{
show.innerHTML ='<img src="http://tbn0.google.com/images?q=tbn:wIVkUD_8SknQYM:http://www.biblepicturegallery"><br/><br/>"E" Image';
}
}
</script>
</head>
<body>
<div id="container">
<img src="http://www.theartshole.com/jpgs/artsholenav.jpg" title="Artshole Image" />
<br/>
<span id="a">A</span>
<span id="r">R</span>
<span id="t">T</span>
<span id="s">S</span>
<span id="h">H</span>
<span id="o">O</span>
<span id="l">L</span>
<span id="e">E</span>

<div id="show">&nbsp;</div>
</div>
</body>
</html>



See if it helps ;)

mlg5454
04-16-2008, 04:42 AM
very impressive!!! i hope you didn't spend too much time on it, that looks extremely complicated...

however, as nice as it looks, the idea is to have each letter hover a vertical word stemming from the hovered letter... from there, for example, when it reads "artists," the user will click the A and go to a separate page wherein we have our list of artists and their corresponding pages....

rangana
04-16-2008, 04:44 AM
Up the corresponding images...or a link...let me see if I could play on those ;)

mlg5454
04-16-2008, 05:47 AM
k, here are all the images

http://www.theartshole.com/stuff/

rangana
04-16-2008, 06:47 AM
Please follow these steps :)

1.) Add this in the head section of your page:

<style type="text/css">
.hide{display:none;}
.show{display:block;}
#message{position: absolute;
left: 150px;
top: 350px;}
span{padding:40px;cursor:pointer;line-height:40px;color:#ccc;}
</style>
<script type="text/javascript">
window.onload = function()
{
var a=document.getElementById('a');
var r=document.getElementById('r');
var t=document.getElementById('t');
var s=document.getElementById('s');
var h=document.getElementById('h');
var o=document.getElementById('o');
var l=document.getElementById('l');
var e=document.getElementById('e');
var show = document.getElementById('show');
a.onmouseover = function()
{
document.getElementById('artists').className='show';
}
r.onmouseover = function()
{
document.getElementById('history').className='show';
}
t.onmouseover = function()
{
document.getElementById('art').className='show';
}
s.onmouseover = function()
{
document.getElementById('releases').className='show';
}
h.onmouseover = function()
{
document.getElementById('shows').className='show';
}
o.onmouseover = function()
{
document.getElementById('videos').className='show';
}
l.onmouseover = function()
{
document.getElementById('listen').className='show';
}
e.onmouseover = function()
{
document.getElementById('read').className='show';
}
}
</script>


2.) Add this code in the anywhere in the body section of your page:

<div id="message">
<span id="a">A</span>
<span id="r">R</span>
<span id="t">T</span>
<span id="s">S</span>
<span id="h">H</span>
<span id="o">O</span>
<span id="l">L</span>
<span id="e">E</span>
</div>


3.) Give your images a class="hide" except the one with artshole id ;)
4.) Start a party :)

Note, step 2 is just a dummy, since you have not cut your images individually yet :)

See if it helps ;)

mlg5454
04-16-2008, 11:34 PM
http://www.theartshole.com/stuff/index2.htm

maybe i did something wrong...

mlg5454
04-17-2008, 02:30 AM
pretty much got it now, css only.

http://www.theartshole.com/stuff/index3.html

except it doesn't wanna work right in IE, of course...

DakotaChick
04-17-2008, 04:37 AM
are you intending for the box overflow to cause the box to scroll rather than just expand to display the overflow?

[Opera 9 browser]

mlg5454
04-17-2008, 03:23 PM
i dont' understand your question.