Visible scrollbars

G

GTi

I have a popup window, If this window is to smaal the scrollbars is
visible.
Is there any JavaScript available so I can check if the scrollbars is
visible on page (right and bottom side)?
Then I can auto resize the window so it dosen't show (until a maximums
size).
 
B

bwucke

GTi napisal(a):
I have a popup window, If this window is to smaal the scrollbars is
visible.
Is there any JavaScript available so I can check if the scrollbars is
visible on page (right and bottom side)?
Then I can auto resize the window so it dosen't show (until a maximums
size).

Certainly others will provide some answer that does exactly what you
want (possibly based on scrollHeight, scrollTop etc) but for now my
answer was BODY {overflow: hidden;} in stylesheets.
 
R

RobG

GTi napisal(a):

Don't even attempt it. Users can maximise their windows with a single
keystroke or mouse click. If their windows are set to a certain size,
it's because they want them that way.

Certainly others will provide some answer that does exactly what you
want

Nah, most don't care for pop-ups at all. Scripts that try to resize
them are just a further annoyance and may well be prevented by user
preference settings anyway.

(possibly based on scrollHeight, scrollTop etc) but for now my
answer was BODY {overflow: hidden;} in stylesheets.

So users can't access the overflow - guess that serves them right for
having a smaller than expected window or monitor.
 
T

Thomas 'PointedEars' Lahn

GTi said:
I have a popup window, If this window is to smaal the scrollbars is
visible.
Is there any JavaScript available so I can check if the scrollbars is
visible on page (right and bottom side)?
Then I can auto resize the window so it dosen't show (until a maximums
size).

You have not thought this through. Consider, for example that users have
a text zoom level that makes it impossible to display the window without
scrollbars on the current screen -- iff there is a (popup) window, and iff
there are scrollbars, provided by a graphical user interface.


PointedEars
 
G

GTi

RobG said:
Don't even attempt it. Users can maximise their windows with a single
keystroke or mouse click. If their windows are set to a certain size,
it's because they want them that way.
My Web Application use popup to fill in some information. Based on the
type of information the window size can vary (don't mention the content
of a combo box).
So instead of hardcode the size I want to leave it to JavaScript to
find the best size whitin maximum bounderies. This is only on popup and
when the page load.
Nah, most don't care for pop-ups at all. Scripts that try to resize
them are just a further annoyance and may well be prevented by user
preference settings anyway.
I mostly agree - but only for public internet sites. For web
applications (mostly intranet) popup is is good thing for filling in
information or see properties for some items.
No - This is no option at all.
So users can't access the overflow - guess that serves them right for
having a smaller than expected window or monitor.

I gues you don't know of a script like this then...
 
G

GTi

Thomas said:
You have not thought this through. Consider, for example that users have
a text zoom level that makes it impossible to display the window without
scrollbars on the current screen -- iff there is a (popup) window, and iff
there are scrollbars, provided by a graphical user interface.


PointedEars

To fill in some more information:
This is only for POPUP windows AND for WEB APPLICATIONS.
And the JavaScript is only used to find the best size of the POPUP
window WHITIN maximum bounderies AT startup only. And if the user WANT
to resize the window after the page is loaded the script will NOT
interfer.
 
T

Thomas 'PointedEars' Lahn

GTi said:
Thomas said:
GTi said:
I have a popup window, If this window is to smaal the scrollbars is
visible.
Is there any JavaScript available so I can check if the scrollbars is
visible on page (right and bottom side)?
Then I can auto resize the window so it dosen't show (until a maximums
size).

You have not thought this through. Consider, for example that users have
a text zoom level that makes it impossible to display the window without
scrollbars on the current screen -- iff there is a (popup) window, and
iff there are scrollbars, provided by a graphical user interface.
[...]

To fill in some more information:

Where there was no need to SHOUT it.
This is only for POPUP windows AND for WEB APPLICATIONS.
And the JavaScript is only used to find the best size of the POPUP
window WHITIN maximum bounderies AT startup only. [...]
^^^^^^^^^^
What is your definition of "at startup"? If it means you want the window
opened with best size for all conceivable content, that is not possible;
unless you implement a layout engine in JS/ECMAScript, of course -- good
luck ;-)


PointedEars
 
V

VK

GTi said:
To fill in some more information:
This is only for POPUP windows AND for WEB APPLICATIONS.
And the JavaScript is only used to find the best size of the POPUP
window WHITIN maximum bounderies AT startup only. And if the user WANT
to resize the window after the page is loaded the script will NOT
interfer.

There are ways to allow/disallow scrollbars, but I do not recall any
method to query like isScrollbarDisplayed (same as with status bar).

But IMHO you're going from the opposite to the right direction:
scrollbars are not a natural phenomenon but a *consequence* of a
content which is too big for the provided viewport. So instead of study
the consequences you can jump right on the reason:
prepare the layout and find it offsetWidth / offsetHeight; then open
the window of the matching size. If the needed size is beyond the range
you still know in advance that scrollbars will appear - and you know
from what side(s).
 
R

Randy Webb

VK said the following on 1/2/2006 10:54 AM:
There are ways to allow/disallow scrollbars, but I do not recall any
method to query like isScrollbarDisplayed (same as with status bar).

But IMHO you're going from the opposite to the right direction:
scrollbars are not a natural phenomenon but a *consequence* of a
content which is too big for the provided viewport. So instead of study
the consequences you can jump right on the reason:

And it is answered here:
<URL: http://allmyfaqs.net/faq.pl?AnySizeDesign >

Now, the size of my text (which you can't account for), my added
toolbars, and anything else is irrelevant and you don't need scripting
to figure it out.
 
G

GTi

When making "ordinary" web pages all this web page guidlines is ok for
me - and I do follow them.
But web pages is more "powerfull" today. We make them more interactiv
and even make them more like a windows desktop applications. And that
is what I want to do.
I used to make desktop applications before. If anyone of you have made
a desktop applications you know that a popup window is needed to fill
in/edit infomation (ex to a database). But the size of the popup
window must fit its content, else it will look like crap.
You can size a web popup window but it is done every time you create a
pop up window.
I always create standard classes and reuse them. And the (auto) size of
a popup window shuld be a function in in the standard class (in my
mind). But as we all now know(!) that can't be done - it must be a
parameter to the class.

But a autosize popup window will still be perfect:
When a user use a larger font:
With autosize: The popup window will resize to fit the content (but the
user can still resize it if he need to).
Without autosize: The popup window will be too small so user MUST
resize the window.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top