You are here:

DHTML/CSS Flyout Rollver Menu..possible?

Advertisement


Question
Hi Andrew,

I was wondering something...I have a rollover menu that I created in Dreamweaver:

http://catalinahotel.com/allie/v2/

I wanted to change it into a flyout menu and was thinking that css might be the easiest way to do it. Is there such a thing as a css rollover flyout menu? Could I use the jpgs I already created to make it?

Thanks!!

Allie

Answer
I think this will suit you very well.  Pure CSS using no JavaScript at all.

http://www.cssplay.co.uk/menus/flyout_4level.html

You should be able to keep the jpgs you've already created as well.  It seems you'll have to use them as a background images in .menu a and hide the text using CSS.

But since you will have different images to use as background images, you'll have to assign IDs to each <a> and reference them in the CSS.

.menu a { /* applies to all <a> inside <ul> with class 'menu' */
text-indent:-9999px; /* hide the link text */
}
.menu a#about_us { /* targets only <a> using id 'about_us' */
background: url('image1.jpg') 0 0 no-repeat;
}
.menu a#catalina { /* targets only <a> using id 'catalina' */
background: url('image2.jpg') 0 0 no-repeat;
}

and so on...

Just make sure to keep your IDs unique, as repeating an ID two or more times will cause unpredictable bugs.

Good luck,
Andrew

DHTML

All Answers


Answers by Expert:


Ask Experts

Volunteer


Andrew Hoffman

Expertise

Ask me about JavaScript, CSS, HTML5/XHTML, or PHP. Chances are I'll be able to help you. I know the economy is in the tank, but if you like my answer, please consider donating a few bucks. It's like tipping your barista, if your barista served fresh code instead of coffee.

Experience

I started doing this when boy bands were still cool.

Education/Credentials
I read a lot of nerdy books to get here.

©2012 About.com, a part of The New York Times Company. All rights reserved.