• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

DHTML Modular Popup

[FX]Roman

Gawd
Joined
Apr 16, 2002
Messages
819
Heya all,

As many know, there's a ton of javascript/css popups out there, but I've been trying to track one down, with minimal success. The type of popup would be centered, a single close button and a shadowed/darkened background - Basically just a presentation box.

If anyone out there has some good ones they've been using, please share!
Many thanks in advance!
 
There are a couple of different ways to approach this.

You can use a javascript framework which takes care of all the crossbrowser stuff and other small details. It still requires that you know CSS, DOM, and Javascript.
If you want to use jQuery:
http://www.wildbit.com/labs/modalbox/
http://www.ericmmartin.com
/projects/simplemodal/

http://jquery.com/demo/thickbox/

ExtJS has tons of UI stuff.

The other approach is that you do it by hand, which really isn't that difficult but will require some basic Javascript/CSS/DOM knowledge.

There may be some premade scripts that do this as well.
 
jeez, these are all so damn slow.

i would implement it by hand....just place (more on this) a hidden <div> where you want the pop-up and unhide it and fill it with DOM elements when you want to use it to present. all this modal stuff seems to use an ajax request to get the content...which is cool for images but for most other stuff i think that just makes things slow for no good reason. the overlay part is easy as well, just set transparency on a div element that sits in a layer above all your normal page elements, and make sure the popup is in a layer above it, and unhide it when you unhide the popup.

only tough part is *placing* the hidden div. most implementations ive seen make its position absolute, then calculate where the middle of the screen is by reading various crap about scrollbar position, screen/window size, etc. its also browser specific...(of course), so i'd look at some of the posted projects (or others) to get some ideas on how to position the popup with various browsers. also may need to use similar info to figure out how big the overlay div needs to be to shade everything.
 
only tough part is *placing* the hidden div. most implementations ive seen make its position absolute, then calculate where the middle of the screen is by reading various crap about scrollbar position, screen/window size, etc. its also browser specific...(of course), so i'd look at some of the posted projects (or others) to get some ideas on how to position the popup with various browsers. also may need to use similar info to figure out how big the overlay div needs to be to shade everything.

...and there lies the devil in the details, you could spend endless hours ripping your hair out trying to get it positioned correctly while working the same with different browsers, and degrade gracefully. Which is why a framework that already solves those problems for you is the easiest solution. BTW, most of those also have settings for configuring the speed of the popup.
 
...and there lies the devil in the details, you could spend endless hours ripping your hair out trying to get it positioned correctly while working the same with different browsers, and degrade gracefully. Which is why a framework that already solves those problems for you is the easiest solution. BTW, most of those also have settings for configuring the speed of the popup.

oh dont get me wrong im probably the first guy to make use of an existing framework because i absolutely HATE dealing with browser compatible quirks heh... its the most tedious, ridiculous bs....

but anyways, my real objection is using browser built-in modal functions or ajax requests to fetch the content for the popup for anything other than images since they involve an http request per pop-up. an http request will never give you a response that's on par with, say, an application window. for most applications i think its much more efficient to preload the content and manipulate DOM elements in a div, plus its damn near instantaneous.....if theres a framework for that (and im absolutely sure there is) definetely...in fact...if anyone has a good recommendation i could definetely use it for a project ill be getting back to work on soon...

but the OP's needs may be different than mine so i apologize for speaking in absolutes, i just happened to have an interest in something similar but require a much more "snappy" interface, and dont mean to discourage any suggestions.

im also pretty tired so excuse my rambling :D
 
Back
Top