I’ve commented about an issue I’ve encountered with a few Impromptu user and I’ve decided to post on it to see if I can get some opinions on the best way to go about solving it. Currently when you open an Impromptu prompt the position of the prompt is centered, and 20% from the top. The position of the prompt is fixed so if you scroll the browser the prompt scrolls with you, staying at a 20% distance from the top. This is all fine and dandy until you have a large prompt; in which case you are unable to scroll down the prompt to view the lower content if it is off the screen.
From what I can tell there are two solutions to this problem:
- Leave it as is and make it the developers responsibility to make sure the prompt isn’t too big.
- Make the position absolute instead of fixed. Make the prompt 20% from the top of the current scrolled position. The prompt will not scroll with you.
In my opinion option 1 looks prettier, and there’s never a chance you scroll away from the prompt. On the other hand option two ensures no matter what, even if the prompt has a ton of content, that you will be able the view the data.
I’ll be honest I never intended on the prompt content to grow very large when I started the project, I just intended to replace normal prompt and confirm boxes. However, now Impromptu has evolved and is a much more versatile tool. Impromptu now has states which should help on this topic by allowing you to break your content up into sections, but is this enough? Please help!
Related posts:


7 Responses
Shad
10|Mar|2009 1How about checking the width and height of the browser window and set the width and height of the prompt to be smaller?
Ben K
10|Mar|2009 2I have a impromptu form where a user can ajax upload an image onto it.
If the image uploaded is large, the impromptu form will grow off the page.
this especially happens if the users are using a smaller desktop size eg 1024×768.
My suggestion would be to add an appropriately named parameter e.g. “fixed” that allows you to either have the box scroll or be fixed.
i was very close to implementing this but i can’t get the darned fader overlay to be fixed in ie6 ;)
trent
11|Mar|2009 3Thanks shad, I just hate to automatically resize the prompt and take the control out the developers hands. I keep getting the feeling of when people use to resize windows with javascript and that aggravated me. Perhaps I should just add an option as Ben K suggest. jQuery now has the dimension functions within it so I can more easily determine the window size, scroll position, etc.. Here’s what I’m thinking:
-Make the fade cover the entire document(not window as it currently does)
-if the option is to use position fixed the prompt will function as normal, this will be the default for backwards compatibility
-if the option is to use absolute, the prompt will get the current scroll position, and place the prompt according to that
This solution might take a little time, I have this and a few more minor changes to make. Please keep commenting with ideas!
Ben K
12|Mar|2009 4i had trouble positioning the fade over the entire document instead of window in ie6. i got frustrated with it and gave up.
trent
12|Mar|2009 5I think the fade in Impromptu takes the height of “box”. Box is just a container for the fade and the prompt. So to make it cover the entire document you will need to change the height of it. Did you try using jQuery’s method to get the document height?
The reason I changed it from this to simply the viewing window’s size is because the document could be smaller than the window, and it left a large unfaded area at the bottom, so I just saw it easier to always make the fade the size of the window.. sorry lol
Pierre Olivier Martel
14|Nov|2009 6So did a solution get implemented? I downloaded the latest version and I get the scrolling problem when my prompt is bigger than my window. I tried setting the prompt to absolute instead of fixed and it worked except that the fade does not cover the whole document.
trent
15|Nov|2009 7As of now this problem still existes, although Impromptu does use a percentage to move as close to the top as possible, long prompts will still encounter this. For large prompts I have have begun organizing the content into columns to keep the height shorter, plus it looks neater. However to answer your question it hasn’t been fixed.
Leave a reply