473,396 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Pretty neat drop-down menu

Check it out here: http://www.amazon.com pass your mouse over the top tab
"SEE ALL 31 Product Categories" and see the nice menu. Is there a way to
do it easily with CSS? I checked out the code, and it's huge, and it uses
JavaScript.
I think it's basically 5 states:

1. Mouse over the tab
2. Fast transparent DIV with 50% width and height and an outline for nice
transition
3. Menu with all categories
4. On mouse out, again, fast transparent DIV with 50% width and height and
an outline for nice transition
5. End

I think it can work without the DOM on regular browsers, but it won't on
IE because the :hover pseudo class can be applied only to A tags.
Maybe there is a tutorial somewhere on the Internet...

--

Kerberos.

http://www.opera.com
http://www.freebsd.org
http://www.auriance.com
http://www.osresources.com
http://exodus.jabberstudio.org
Jul 21 '05 #1
4 6177
Kerberos <me@privacy.net> wrote:
Check it out here: http://www.amazon.com pass your mouse over the top tab
"SEE ALL 31 Product Categories" and see the nice menu. Is there a way to
do it easily with CSS? I checked out the code, and it's huge, and it uses
JavaScript.
I think it's basically 5 states:

1. Mouse over the tab
2. Fast transparent DIV with 50% width and height and an outline for nice
transition
3. Menu with all categories
4. On mouse out, again, fast transparent DIV with 50% width and height and
an outline for nice transition
5. End

I think it can work without the DOM on regular browsers, but it won't on
IE because the :hover pseudo class can be applied only to A tags.
Maybe there is a tutorial somewhere on the Internet...


Actually, there is a way to get IE to recognize the :hover
psuedo-class. (NOTE: I don't think I'm seeing the same amazon page as
you, so I'm not sure exactly what you're looking at...)

See this page for an explanation:

http://www.xs4all.nl/~peterned/csshover.html

I used the code provided here:

view-source:http://www.xs4all.nl/~peterned/htc/csshover.htc

for page on my site in order to get IE to use :hover on p elements:

http://roth-sisley.net/DaveStuff/index.html

[warning: the server is off at night (California time).]

I'll admit I don't understand exactly how it works, but by using it,
IE6 displays my page the same way firefox does. The one drawback is I
get an error when I validate the css:

"Property behavior doesn't exist : url(hover.htc)" (ha ha).

Perhaps you could use something similar and avoid the javascript.

-dave.

--
Dave Sisley
ds*****@sonic.net
roth-sisley.net
Jul 21 '05 #2

"Dave Sisley" <ds*****@sonic.net> wrote in message
news:xN*******************@typhoon.sonic.net...

Actually, there is a way to get IE to recognize the :hover
psuedo-class. (NOTE: I don't think I'm seeing the same amazon page as
you, so I'm not sure exactly what you're looking at...)
It doesn't get IE to recognize :hover. It goes through all the styles on the
page and *replaces* (some of) the ones that include :hover with a class name
that IE *will* recognize.

See this page for an explanation:

http://www.xs4all.nl/~peterned/csshover.html

I used the code provided here:

view-source:http://www.xs4all.nl/~peterned/htc/csshover.htc

for page on my site in order to get IE to use :hover on p elements:

http://roth-sisley.net/DaveStuff/index.html

[warning: the server is off at night (California time).]

I'll admit I don't understand exactly how it works, but by using it,
IE6 displays my page the same way firefox does. The one drawback is I
get an error when I validate the css:

"Property behavior doesn't exist : url(hover.htc)" (ha ha).

Perhaps you could use something similar and avoid the javascript.


It doesn't avoid Javascript. That's what csshover.htc is coded in. No
Javascript, no behaviors.

Jul 21 '05 #3
Harlan Messinger <h.*********@comcast.net> wrote:

"Dave Sisley" <ds*****@sonic.net> wrote in message
news:xN*******************@typhoon.sonic.net...

Actually, there is a way to get IE to recognize the :hover
psuedo-class. (NOTE: I don't think I'm seeing the same amazon page as
you, so I'm not sure exactly what you're looking at...)
It doesn't get IE to recognize :hover. It goes through all the styles on the
page and *replaces* (some of) the ones that include :hover with a class name
that IE *will* recognize.


Oh. Thanks for that. I (insanely) just installed the script and
linked to it from my stylesheet. It worked, and I was busy with other
stuff and never went back to see what it actually does.

See this page for an explanation:

http://www.xs4all.nl/~peterned/csshover.html

I used the code provided here:

view-source:http://www.xs4all.nl/~peterned/htc/csshover.htc

for page on my site in order to get IE to use :hover on p elements:

http://roth-sisley.net/DaveStuff/index.html

[warning: the server is off at night (California time).]

I'll admit I don't understand exactly how it works, but by using it,
IE6 displays my page the same way firefox does. The one drawback is I
get an error when I validate the css:

"Property behavior doesn't exist : url(hover.htc)" (ha ha).

Perhaps you could use something similar and avoid the javascript.


It doesn't avoid Javascript. That's what csshover.htc is coded in. No
Javascript, no behaviors.


Thanks again. I don't know javascript, which is why I try to avoid
using it. I should have realized, though. I need to experiment with
this little block of code on some other pages, but I like how easy it
was to implement. I guess what I avoided was having to write any
javascript *myself* (smiley).

-dave.
--
Dave Sisley
ds*****@sonic.net
roth-sisley.net
Jul 21 '05 #4
Dave Sisley wrote:
Harlan Messinger <h.*********@comcast.net> wrote:

It doesn't avoid Javascript. That's what csshover.htc is coded in. No
Javascript, no behaviors.


Thanks again. I don't know javascript, which is why I try to avoid
using it. I should have realized, though. I need to experiment with
this little block of code on some other pages, but I like how easy it
was to implement. I guess what I avoided was having to write any
javascript *myself* (smiley).


More importantly, it keeps all the scripting in one place, rather than
having it scattered throughout ones markup & is a much prettier modular
solution as a result. Furthermore, the script is only ever used by IE
clients (who I, um, don't exactly have a lot of respect for - unless
they're being forced to use the wretched filth).

Given one almost always needs to support IE, this seems like as clean a
solution as one can get, whilst letting decent browsers work largely
unhindered by hideous IE hacks (just the one behaviour inclusion line
which they need to ignore).

I don't suppose there's a way to wrap that css line up such that the
resulting code still functions in IE but will also validate?

--
Michael
m r o z a t u k g a t e w a y d o t n e t
Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Frances Del Rio | last post by:
http://www.emol.com/especiales/cocina_chilena/comida.asp this page is so neat (goes in pop-up..) how was this done? how do you give a layer (or div, I guess) a semi-transparency so you can still...
1
by: riehe | last post by:
Dear all I want to drop a node from a nodegroup. Can someone confirm if its enough to redistribute a node group with a partition map which doesn't include the node to be dropped? I can't see...
0
by: Lauren Quantrell | last post by:
I'm trying to drop a file from Windows Explorer (or desktop, etc.) onto a field in Access2K and capture the full file path. I found an posting below that says this is possible but I cannot...
1
by: Piotrek Stachowicz | last post by:
Hi there, I'd like to display list of items in my form. Each item has 3 properties i.e. description , picture (1 of 3 kinds), and url. I want to display it in nice way, e.g. every second row...
10
by: Brian | last post by:
Hello all, I have an form to Enter a Name with letters from A to Z in buttons. When you click a button, it should append the text associated with that button to a text box. Instead of...
6
by: jojobar | last post by:
Hello, I look at the asp.net 2.0 web parts tutorial on the asp.net web site. I tried to run it under firefox browser but it did not run. If I want to use this feature in a commercial product...
7
by: Ed Debrot | last post by:
Nothing drives me crazier than having to look at someone's code where the indentation is sloppy. Some lines are indented 2 spaces, others 10 spaces. Sometimes there's 10 blank lines between lines...
1
by: Alex Karuso | last post by:
I found this quick CSS search site the net. You type style name, it gives you style options and help right away. Neat. I thought I'd share it with others - http://www.gotapi.com
15
by: uwcssa | last post by:
I try to drop a table as: I got: During SQL processing it returned: SQL0478N The object type "TABLE" cannot be dropped because there is an object "sch.SQL070515104729271", of type "FUNCTION",...
5
by: Romulo NF | last post by:
Greetings, I´m back here to show the new version of the drag & drop table columns (original script ). I´ve found some issues with the old script, specially when trying to use 2 tables with...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.