You are here: Re: triggering events wtih css « HTML « IT news, forums, messages
Re: triggering events wtih css

Posted by Ben C on 03/26/07 16:09

On 2007-03-23, Jon Slaughter <Jon_Slaughter@Hotmail.com> wrote:
>
> "Ben C" <spamspam@spam.eggs> wrote in message
> news:slrnf08h88.apu.spamspam@bowser.marioworld...
>> On 2007-03-23, Jon Slaughter <Jon_Slaughter@Hotmail.com> wrote:
>>> is it possible to trigger events with css or is it purely a static
>>> scripting
>>> language? I have a menu that contains sub menu's and when the user clicks
>>> on
>>> the main link I want to set the visibility to show the sub menu(and
>>> ofcourse
>>> hide the visibility for all other sub menu's). Is the only way to
>>> accomplish this with js or does css have some ability to handle things
>>> like
>>> this?
>>
>> This kind of thing is possible to some degree with CSS. RTFM "pseudos",
>> "pseudoselectors", :hover and the visibility property.
>
> But how can you modify a property of some other style? e.g., If I hover over
> a button I want to set the visibility property of a table.
>
> For example, suppose I have
>
> #SomeTable {
> visibility:hidden;
> }
>
> a:hover
> {
> SomeTable.visibility:visible;
> }

You can put pseudos anywhere in the selector, so e.g.:

#something:hover span
{
visibility: visible;
}

Makes spans that are descendents of the hovered #something visible.

You can just about do nested pop-up menu systems with this kind of
thing.

If the hovered node and the node whose properties you want to switch are
related in ways not expressible in CSS selectors you'll need to use JS
instead.

[...]
> Can I change the properties of other styles within a style?

No.

> I'll read up on css and see if I can find the answer but I don't think
> of I have seen anything like before.

If you mean like this:

> a:hover
> {
> SomeTable.visibility:visible;
> }

then nor have I!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация