Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Website rollover menu dev help

Author
Message
Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 25th Jun 2009 21:37
Hello all,

I am working on a site for a client in which I need to get a menu like this working:



When the user scrolls over the work tab, I want "Print, web, ect..." to appear horizontally underneath and be clickable. Every button has a roll over effect.

I figured doing this is in flash might be the best way to do it, but I have 0% knowledge with Flash. Is Flash the way to go here, or does anyone have any suggestions on how to go about this?

I don't expect you to give me teh codez, but if you could point me in the right direction/give some advice on how to best do this, I would greatly appreciate it.

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
Current Project: http://strewnfield.wordpress.com/ (Last updated 06/11/09)
Megaton Cat
21
Years of Service
User Offline
Joined: 24th Aug 2003
Location: Toronto, Canada
Posted: 26th Jun 2009 00:10
I can't tell you teh codez but I just wanna say I've seen that effect done always without flash so don't even bother.
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 26th Jun 2009 00:30 Edited at: 26th Jun 2009 00:31
[edit] Not quite the same...

Anyway, pretty sure this can be done with just javascript.

Clbembry
18
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Minnesota
Posted: 26th Jun 2009 00:35
You shouldn't use Javascript because you have the option to turn it off. Some people do this to prevent those annoying pop-ups. I'm pretty sure I know how to do this, I'll try and see what I get.

If it works I'll give you teh codez.
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 26th Jun 2009 01:31
You can use javascript to either replace the links contained within a DIV or SPAN when you roll over the link or just use hidden DIVs and show/hide them as needed.

[url="http://dbcc.zimnox.com"][/url]
Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 26th Jun 2009 01:53
Ugh, I have a bad cold right now, I can't even begin to tinker with the code. I feel like my head is going to explode like a Boomer from Left4Dead.

So no go with Flash, awesome, I actually do know some javascript. I had a 10 week class on it two semester's ago. I'll do some googling to see if I can find any good examples and hack something together after this nasty is head cold is gone.

*moans*

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
Current Project: http://strewnfield.wordpress.com/ (Last updated 06/11/09)
Clbembry
18
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Minnesota
Posted: 26th Jun 2009 01:55
Don't use javascript.
BiggAdd
Retired Moderator
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 26th Jun 2009 02:08 Edited at: 26th Jun 2009 02:10
You can do this with CSS.

Observe:


Hope that helps. Code is a little messy (Probably some commands in there that don't need to be there)

Cheers,
BiggAdd

Clbembry
18
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Minnesota
Posted: 26th Jun 2009 02:17
Beat me too it BigAdd


Oh well
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 26th Jun 2009 02:29
Do those CSS rollovers work in every browser?

[url="http://dbcc.zimnox.com"][/url]
Clbembry
18
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Minnesota
Posted: 26th Jun 2009 02:33 Edited at: 26th Jun 2009 02:34
Yes, but you might need to use "IE hacks".
BiggAdd
Retired Moderator
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 26th Jun 2009 11:17 Edited at: 26th Jun 2009 11:27
There might be some positioning issues, and perhaps flickering, but the main problem is IE's lack of the understanding of :hover when its not applied to a link.

You can use this tiny bit of javascript:


And replace the hover command with:
li:hover ul, li.over ul{..........}



I found the hack a while back from here:
http://www.alistapart.com/articles/dropdowns/

BiggAdd
Retired Moderator
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 26th Jun 2009 12:45 Edited at: 26th Jun 2009 13:20
Double Post:

Here is a fully working menu (That matches your design style)






With a few minor changes, you can convert the above to drop down boxes:





And because they both use Absolute positioning, it shouldn't mess up the layout of anything underneath.
For Example:







Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 26th Jun 2009 20:11
WOW! Thanks a TON BigAdd, very nice code. I should be able to replace that text with images though right? I don't see why not, I'll tinker with it later.

Thanks again!

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
Current Project: http://strewnfield.wordpress.com/ (Last updated 06/11/09)
Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 26th Jun 2009 23:23 Edited at: 26th Jun 2009 23:23
BigAdd, I got the menu code to work and it's all in place, but IE is still having trouble even WITH that hack you posted.

Visit the link in both FF and IE to see what I mean: http://www.landgraff.com/newsite/index.html

What's the next step in fixing the IE issue?

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
Current Project: http://strewnfield.wordpress.com/ (Last updated 06/11/09)
BiggAdd
Retired Moderator
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 27th Jun 2009 00:43 Edited at: 27th Jun 2009 01:03
I think there is a conflict with your rollover javascript code and the menu code.

What I would suggest is replace your javascript rollover and use CSS.

If you need to use an image for the "work process etc etc", then I suggest using a background replace for the <a> tags using CSS.

I'll whip up an example now, and test it in firefox and IE.



BiggAdd
Retired Moderator
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 27th Jun 2009 01:00 Edited at: 27th Jun 2009 11:23
Ok I think i've got it sorted.



Seems to be working in firefox and IE. It also removes the messy javascript from your markup.

One thing I would add (which I didn't in that code snippet), is a slice of javascript to pre-load the image files.

Something like:
<script type="text/javascript">
{
pic1= new Image(48,32);
pic1.src="images/button_work.png";
}
</script>

If you don't do this, when you initialy hover over a menu item, it won't show for a split second (as the image is loading)


Hope this helps!

(Nice website btw!)

Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 27th Jun 2009 06:47
You pretty much have to use javascript for most things fancy and interactive with HTML. I don't know anyone that turns it off 100% of the time, actually.

BiggAdd
Retired Moderator
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 27th Jun 2009 18:16 Edited at: 27th Jun 2009 18:18
But you can do a lot with CSS.

I just noticed I put the Javascript for the IE hack in a <style> instead of a <script> Not sure if that makes a difference. (But the new image code I posted above should do you fine!)

Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 27th Jun 2009 18:47 Edited at: 27th Jun 2009 18:53
Yeah, that made a lot of different actually

That works in IE for you? I just get a blank page still. I'm using IE7.

EDIT:

After running a browser compatibility check it returns:

Unsupported Value: 'inline-block' (multiple lines)
Error Parsing Style: font: font-weight:700
Double Float Margin Bug (multiple lines)

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
Current Project: http://strewnfield.wordpress.com/ (Last updated 06/11/09)
BiggAdd
Retired Moderator
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 27th Jun 2009 18:58 Edited at: 27th Jun 2009 19:30
I got rid of the inline-blocks and the font-weight problem.

Try this:


I'm using IE8 btw.

[EDIT]
I just tried it in IE6, but it returns a blank page.
I hate Internet Explorer so much! But it seems to work in IE7

I'll have a little play around later, see if I can get it working in IE.

Sorry for the wait!

Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 27th Jun 2009 19:39
I hate IE as well, it complicates everything. Why not just go with the standards? Why does MS have to try and pave the way in everything? /rant

Alright, thanks. I really appreciate the help with this. Hopefully we can get this working 100%!

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
Current Project: http://strewnfield.wordpress.com/ (Last updated 06/11/09)
BiggAdd
Retired Moderator
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 28th Jun 2009 13:42 Edited at: 28th Jun 2009 13:49
Good news!

I got it all working in IE6, IE7, IE8 and Firefox!



Huzzah!

Hope this helps!

Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 29th Jun 2009 23:10 Edited at: 30th Jun 2009 01:38
Just saw this! Thanks! From the initial test it sure does! I'm going to integrate with the site right now. I'll edit this post to confirm it.

Works great! Here is the final result: http://www.landgraff.com/newsite/index.html

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
Current Project: http://strewnfield.wordpress.com/ (Last updated 06/11/09)
xplosys
19
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 30th Jun 2009 05:32
BiggAdd,
Great work on the CSS. I hope you don't mind if we all take advantage of it.

Sid Sinister,
The site is simple and elegant. Great design.

Brian.

BiggAdd
Retired Moderator
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 30th Jun 2009 12:42
Quote: "Great work on the CSS. I hope you don't mind if we all take advantage of it."

Help yourself!

Quote: "
Works great! Here is the final result:"

Glad it works! You don't need that rollover javascript code in your markup you know?

The whole point of this in the CSS:


Is to remove the need for that. If you want to keep the javascript, you can remove the above from the CSS.

draknir_
18
Years of Service
User Offline
Joined: 19th Oct 2006
Location: Netherlands
Posted: 30th Jun 2009 14:11
Cheers indeed, very nice CSS code. I didn't know this was possible with CSS
Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 30th Jun 2009 17:22 Edited at: 30th Jun 2009 17:22
Dang, I thought I had unchecked the "preload images" button on the rollovers... Thanks, I'll remove them and add in new lines to the CSS preload code for the other images.

@xplosys: Thanks

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
Current Project: http://strewnfield.wordpress.com/ (Last updated 06/11/09)
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 1st Jul 2009 03:44
Quote: "You shouldn't use Javascript because you have the option to turn it off."

These days, disabling Javascript is like disabling HTML.

That CSS menu is quite nice though, I really like it. I may use it. If not just learn from it

Your mother has been erased by a mod because it's larger than 600x120
Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 6th Jul 2009 20:43
I've gotten rid of the rollover button code and changed everything over to your CSS hover method. However, it produces this weird result when you click on the button. Is there anyway to prevent this? I've made a 5 second video of it. http://screencast.com/t/CGXiyYwNPS

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
Current Project: http://strewnfield.wordpress.com/ (Last updated 06/11/09)
BiggAdd
Retired Moderator
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 6th Jul 2009 23:59 Edited at: 7th Jul 2009 00:00
Hey Sid,

Sorry I diddn't notice the problem. In this block of CSS:
Quote: "a:link, a:visited {
color: #9b9389;
text-decoration: none;
padding: 0;
margin: 0;
display: block;
padding: 0 10px 0 10px;
}"


add the command:

overflow: hidden;



Should fix the problem.

Cheers,
BiggAdd

Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 7th Jul 2009 00:51
Hmmm, that still didn't do it. I updated the website with the new code, I forgot to do that when I asked the question, so if you just looked at it, look at it again.

http://www.landgraff.com/newsite/index.html

IE doesn't seem to do it, but Firefox does.

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
Current Project: http://strewnfield.wordpress.com/ (Last updated 06/11/09)
BiggAdd
Retired Moderator
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 7th Jul 2009 01:19 Edited at: 7th Jul 2009 01:20
From your code:
Quote: ".menu a:link, .menu a:visited {
color: #9b9389;
text-decoration: none;
padding: 0;
margin: 0;
display: block;
padding: 0 0px 0 0px <- This might be your problem There is no ";" to complete the command
overflow: hidden;
}
"


Try closing the above and see if it works!

dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 7th Jul 2009 04:27
Very nice BiggAdd, I was going to suggest the same method, but I don't think I would have coded the thing!

Beautifully done!

Need a hideout for conversations? dab-Media IRC. irc.dab-media.com:6667
PHP coder for hirer. Freelance/Job Email me.
Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 7th Jul 2009 06:24
Ah! That did it, great catch. I guess I should have ran it through a HTML checker. It probably would have spotted that. Thanks again BigAdd!

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
Current Project: http://strewnfield.wordpress.com/ (Last updated 06/11/09)
Clbembry
18
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Minnesota
Posted: 7th Jul 2009 07:53
Quote: "These days, disabling Javascript is like disabling HTML."


I know quite a few people that turn off Javascript to block annoying pop-ups.

Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 7th Jul 2009 23:45
Is it possible to use that CSS rollover/hover technique to change multiple images when you scroll over one image?

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
Current Project: http://strewnfield.wordpress.com/ (Last updated 06/11/09)
BiggAdd
Retired Moderator
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 8th Jul 2009 01:19
How do you mean?

Clbembry
18
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Minnesota
Posted: 8th Jul 2009 01:21
Quote: "Is it possible to use that CSS rollover/hover technique to change multiple images when you scroll over one image?"


I don't think you with CSS alone. That is something that will probably require Javascript.

BiggAdd
Retired Moderator
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 8th Jul 2009 01:57 Edited at: 8th Jul 2009 02:02
Something like this perhaps?


Note - You don't have to use links if you only want a simple background replace, but I used links just for this demonstration. you can use any html element.


Also this bit of code demonstrates the need for the duplicate links:


Notice when you hover over the links in this one, the backgrounds change. (There is probably a simpler way to get round this, but I can remember it!)


Cheers,
BiggAdd

Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 8th Jul 2009 18:52
Well, the problem I'm having is in the way I sliced up the image. I'm probably just going to reslice it and stop being lazy, but I kind of wanted to reuse my frame images that make up the background.

Here is a video showing you the problem: http://screencast.com/t/hfRJ7SC1TS

Basically the way I sliced it up was to include 1 pixel of the white area on both the top and right in that image. That works on all the other sides, but when it comes to that side it doesn't because the tear rollover changes the top and right brown frames.

I'm not sure if you follow. If not, don't worry about it, I'm most likely just going to reslice anyway. Preloading two 1024x45 images probably won't be the best thing to do. I was curious about the answer though anyway for future reference

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
Current Project: http://strewnfield.wordpress.com/ (Last updated 06/11/09)
BiggAdd
Retired Moderator
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 8th Jul 2009 19:07
I don't know what you mean sorry!

Probably best to re-slice it!

Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 8th Jul 2009 19:42
Yup, already done with that. Should have just went that route to start with lol.

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
Current Project: http://strewnfield.wordpress.com/ (Last updated 06/11/09)

Login to post a reply

Server time is: 2025-05-30 14:09:49
Your offset time is: 2025-05-30 14:09:49