From: [s]underwater[/s] under-snow in Juneau Insane since: Sep 2002
posted 09-22-2002 01:57
Ok, the other day I was cruising the Asylum forums and clicked on someones homepage. They had examples of CSS rollovers(not text or backgound color, I know those) that worked like DHTML menus, when you would hover on a Link an nearby elements visibility was changed, with no javascript. Slick !! But I forgot to bookmark the page. Anybody know how this is coded?
when I know everything, will my brain
stop hurting so much when I code?
From: [s]underwater[/s] under-snow in Juneau Insane since: Sep 2002
posted 09-22-2002 05:30
petskull:
ONMOUSEOVER="getElementById('thing').style.visibility=visible" ONMOUSEOUT="getElementById('thing').style.visibility=hidden" looks suspiciously like javascript to me, nooo..... (gasp) that's DHTML manipulating that element!
Thanks, that code snippet will aid me in my pursuit of javascript mastery, but I'm also quite intrigued by the possibilities of fancy pure CSS manuvers.
pugsly:
RightOn!!!! You have my undying and eternal gratitude. That is the page I've been searching for!! I'll remember to bookmark it this time. THANKS
when I know everything, will my brain
stop hurting so much when I code?
From: [s]underwater[/s] under-snow in Juneau Insane since: Sep 2002
posted 09-22-2002 07:06
I visited that site a few minutes before reading your post and WTF was my reaction too.
Looked at the external CSS sheet and it doesn't appear to change any display or visibility properties with a " :hover" for a child attribute. I'm baffled (but then I'm not really the sharpest Crayon in the box ya know).
when I know everything, will my brain
stop hurting so much when I code?
From: 127 Halcyon Road, Marenia, Atlantis Insane since: Aug 2000
posted 09-22-2002 15:22
ok, two things:
1- there is no: /*--------------Code for each link-----------*/ in the stylesheet, there is only: /*----------------Links Spec------------------*/ --Is this what you mean?
2- the drop-down options are indeed in a SPAN with the 'nav' class, but I can't seem to find it in the stylesheet...
what is going on? this page gets wierder the more I look at it...
PS: Thats odd - when I said that was it in full I meant the bit that did the rollovers. however, that is nothing like the styles I'm seeing. I wonder if we are even talking about the same thing - I (and JKMabry) were referring to Phil's page - specifically: http://www.scansped.co.uk/new/css/global.css
Hi there I also fell in love with scanspeds rollovers, they do look great!
I took the principle and made the menu here: http://www.qm-konsult.se/ for a client.
It's all CSS and some javascript (no NS4/Opera though)
The idea is quite simple (as all the really nifty things are) when it comes to the rollovers.
First you can give a link a class that specifies that the link should be 150px wide and 20px high with a 1px border and you set the std color/font all that.
Place this absolutley or relatively according to your needs.
Give all the links that class, then you go into the link-states
To create the submenus, I simply enclosed the sublinks in a div that I'm showing and hiding through js.
The interesting part was to write all of this dynamically through php as pages are added through a cms in the background... but that's another story.
/Dan
{cell 260}
-{ a vibration is a movement that doesn't know which way to go }-
From: there...no..there..... Insane since: May 2001
posted 09-24-2002 03:37
I think that this sort of thing is going to be more and more common. The only bad thing about Eric Meyers page is that it only works in Mozilla 1+
Love Scanspeeds page and DmS's is right fine in itself.
I have started to do little "templates" on menus that use these kind of things. Hopefully I will get around to finishing my website and have them
uploaded.
Anyway, great stuff and very inspirational.
Later,
C:\
Oh, and Petskull. I did the samething you did. I was totally confused on how Phil did his page. The more I looked at it, the more I got myself confused.
~Binary is best~
[This message has been edited by CPrompt (edited 09-24-2002).]
lol...Petskull.... ....sorry to confuse you on this. Ok, you and Emps have found 2 x global.css sheets, but in different parts of the site. The one you found Pets, was written almost a couple of years ago, and it sucks big time, and needs major surgery which is what I'm playing around with offline in my site re-design at the moment.
The style sheet your looking for was written after I found Erics demo some months back, and it's tucked away in a seperate folder. I know that Emps picked up on Erics page also and wondered where the concept could be taken, I just decided that it could look a bit cooler than it did - hence the dhtml lookalikes. The one unfortunate thing in writing those rollovers was that you can't get a submenu in pure css to appear although I've tried. The only way is as dms has done in javascript but maybe one day I guess as things develop further.
One thing that's greatly different using a css only package, is that these rollovers are so damned fast.......
All credit goes to Eric for the <span> idea, I just took his intial concept and played with it (a lot)....
I've browsed some around in all your threads regarding the rollover-effect. I've chosen to use Eric Meyers way of making the effect, since I like it as simple as the code, he provides. One of my friends stumbled into a problem. First of all - a small side-note - I'm the absolute newbie @ programming css, and programming in general for that matter.
But: nevertheless, he couldn't make the roll-over effect work otherwhere than on the text itself, thus if - like Eric Meyer - you have a link in a menu (in some box) you will only see the effect, when the mouse hovers exactly over the text. My friends' solution was some trick with putting <a>'s around the <td>'s he was using in his table-layout. I use css-absolute-positioning for my layout, so I tried to provide my menuitem-ID with a "WIDTH: ??px;" (where ?? is some width, that matches the need), and the problem was solved!
Note: I use several styles/id's for one object, in this case a menu-item. In the ID "#menuitem" I've defined a width for the width of the menu itself, and the width, I described above, I put into the ID "#menuitem a".
I don't know, if this is even a trick, but since I couldn't find a solution myself in here, I thought I might post it. Hope it is of some use - otherwise you may have my newbie-ness excused!
Frederik Schøning
frederik@spacy.dk
Denmark
[This message has been edited by Madbyggeren (edited 05-15-2003).]
[This message has been edited by Madbyggeren (edited 05-15-2003).]
From: Northumberland, England Insane since: Apr 2003
posted 05-17-2003 18:04
if you want a whole box to be the link and not just the text conatined within it you need to add 'display:block;' to your css for the rollover effects.
you realise you can also do rollover images with only css, it's the way forward and is supported in all recent browsers except maybe the really obscure ones that some people for some reason see fit to use.