Forum Moderators: not2easy

Message Too Old, No Replies

Styling scalable popup windows

smallest code possible... CSS or JS?

         

supaflyryan

6:58 pm on Dec 21, 2006 (gmt 0)

10+ Year Member



I'm working on a project where I need to style a standard popup window. No need to go chromeless, etc, but there are different fixed sizes of windows that will be brought up by the user. They all need to have the same background, which consists of a border all the way around with a small logo in the top left and the bottom right.

I'm trying to slice the images and insert them in a way where we can use the same images no matter what the window size, but the smallest amount of code.

I've tried the sliding doors technique and no matter how I do it, I end up with basically 9 divs with the content in the center. I would like to make this happen with less divs, if possible.

Would there possibly be an easier way to do this with Javascript or anything else?

Fotiman

7:55 pm on Dec 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Ignoring the fact that popups are a bad thing, ESPECIALLY when you give them a fixed width...

They all need to have the same background, which consists of a border all the way around with a small logo in the top left and the bottom right.

What does this border look like? Is it a repeating pattern? Can it be tiled? Could you post some code so we have an idea of what you're starting with?

supaflyryan

8:21 pm on Dec 21, 2006 (gmt 0)

10+ Year Member



The popups aren't for ads, they are necessary for the project. Think of them as dialog boxes/settings panels.

They are resizeable, but don't necessarily need to be. The information inside them is static, but there are several different windows, thus the need for the same code to deal with different sizes.

I ended up modifying this method:

[schillmania.com...]

I ended up getting what I wanted, but the problem is in how much code I have. This method requires 9 different classes to allow scaling.

The border, although looks nothing like that example, follows the same structure. Imagine a logo in the top left, and the bottom right, using his images.

Since I ended up getting it to work, I'm not dissatisfied, but I just wonder if there is an easier way to get this done with less code.

Fotiman

10:31 pm on Dec 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You might check out theYahoo UI Libary [developer.yahoo.com]'s Container [developer.yahoo.com] family of components, including Dialog and SimpleDialog. Not sure if it's more or less code, but it's an alternative at least.