Re: Rethinking My Use of Modal Windows....

Giganews Newsgroups
Subject: Re: Rethinking My Use of Modal Windows....
Posted by:  Ben C (spamspam@spam.eggs)
Date: Fri, 02 May 2008

On 2008-05-02, Prisoner at War <prisoner_at_w…> wrote:
> I think I may still have a use for a modal window or two for my
> website (like when some prankster enters in "fuck fuck fuck" in my
> search engine!) but I think maybe I should have a less "intrusive" or
> "in-your-face" way of presenting "optional information," the sort you
> associate with sidebars or even footnotes.
> How about a comic book-style thought or dialog balloon onMouseOver?

Easily done.

> Yeah, that'd be awesome!  Only pops up onMouseOver and still allows
> access to the rest of the page while displayed, while disappearing on
> its own without needing the user to click an "okay" or "back" link or
> button.
> I wonder, could I somehow use the modal window code I have to achieve
> the same thing, only without "freezing" the webpage?

> Moreover, how do I style the thinggy to look like a comic book thought
> balloon??

Don't use a real modal window, instead use a "Web 2.0 popup".

Get a DIV, give it a transparent background and a background image that
looks like a speech bubble, with transparent pixels around its rounded
corners. Make the DIV visibility: hidden.

Then use JS to change it to visibility: visible when you want it to pop
up. The rest of the page won't be frozen.

> That thought balloon would be a kind of pop-up window, with
> information (text), but it only appears onMouseOver and disappears
> (with a nice little fading away effect, I hope!) just as easily...yet
> it has to *look* like a comic book-style thought balloon and not just
> another box or rectangle with text!
> How would I style such a thinggy??

Fading away can be done but is a bit more tricky. You'd need to set the
element's opacity gradually from 1.0 to 0.0 before making it visibility:
hidden when it reached 0. For that you use setInterval (or setTimeout
but I prefer setInterval). I think we explained this the other day.


In response to

Rethinking My Use of Modal Windows.... posted by Prisoner at War on Fri, 2 May 2008