nntp2http.com
Posting
Suche
Optionen
Hilfe & Kontakt

Re: Toggling visibility in css, not javascript

Von: cwdjrxyz (spamtrap2@cwdjr.info) [Profil]
Datum: 05.08.2008 03:26
Message-ID: <24a556cf-787f-4585-a26d-db489eb7ed3a@r66g2000hsg.googlegroups.com>
Newsgroup: alt.html
On Aug 4, 1:23 pm, Chris <spam_me_...@goaway.com> wrote:
> Is there a way that I can toggle the visibility of a div on and off
> using css alone? It's a bit inconvenient in our app to use javascript her
e.
>
> Googling around, I found two tricks, neither of which quite does it. One
> toggles visibility on hover, and the other creates a dummy checkbox,
> styles it so it doesn't look like a checkbox, and then has different
> styles for the checked/unchecked states. Clever, but it's hard to use
> checkboxes like this in our app.
>
> I'm thinking the challenge here is to maintain state using css alone.
> Probably not possible, but thought I'd ask.

As others have indicated, it seems you can do this with css alone
without JavaScript and have your code work as intended on most popular
current browsers.

If you can use php on your server, it is likely you could do this
server side with php. It quite often is possible to do the same thing
with php server side as it is to do it with JavaScript on the browser.
And you usually do not have to worry about the response of different
browsers and if the viewing browser has script turned on or off. I do
not know the details of your code, but I have used php to turn
visibility on and off on some of my pages.

[ Auf dieses Posting antworten ]

Antworten