473,387 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Visible scrollbars

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).

Jan 2 '06 #1
10 2144

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.

Jan 2 '06 #2
bw****@gmail.com wrote:
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).

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.
--
Rob
Jan 2 '06 #3
GTi wrote:
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
Jan 2 '06 #4
GTi
RobG wrote:
bw****@gmail.com wrote:
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).

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.

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.

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.

(possibly based on scrollHeight, scrollTop etc) but for now my
answer was BODY {overflow: hidden;} in stylesheets.
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.
--
Rob


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

Jan 2 '06 #5
GTi
Thomas 'PointedEars' Lahn wrote:
GTi wrote:
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


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.

Jan 2 '06 #6
GTi wrote:
Thomas 'PointedEars' Lahn wrote:
GTi wrote:
> 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
Jan 2 '06 #7
VK

GTi wrote:
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).

Jan 2 '06 #8
VK said the following on 1/2/2006 10:54 AM:
GTi wrote:
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:


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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 2 '06 #9
Randy Webb a écrit :
VK said the following on 1/2/2006 10:54 AM:
GTi wrote:
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:

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.


Allow me to help you make your list more complete:

http://developer.mozilla.org/en/docs..._on_scrollbars

Gérard
--
remove blah to email me
Jan 3 '06 #10
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.

Jan 3 '06 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mickel Grönroos | last post by:
Hi, I have a Tkinter.Canvas of variable width. Is there a standard way of asking the canvas which parts of it that is visible? I.e. on the horizontal scale, I would like to know at what fraction...
1
by: Vangelis Natsios | last post by:
I want to create a page with a scrolling image that will cause different messages to appear on another part of the page (say, another <div>) as the image will scroll. Imagine something like this: ...
24
by: Nobody | last post by:
Okay, you are all so smart in here. Answer me this: IE6 in standards mode doesn't seem to hide scrollbars on the body element (overflow:hide) Ain't this a quandary. I have it in my head that I...
1
by: Ben Reese | last post by:
I might be blind, but I cannot find a way to ensure that a particular row in my data grid is visible i.e the grid is scrolled so that the row at the current position of the currency manager is...
2
by: Turgeson | last post by:
Is there anyway to determine if a DIV with its overflow style set to auto has the scrollbars visible? I have a dynamically built table inside my DIV. If the table is over a certain height and the...
2
by: delraydog | last post by:
Is there anyway to detect if scrollbars were made visible in a textarea? I'm not talking about initial setting of the scrolling attribute, but rather whether scrollbars have been added either...
3
by: andrew.neale | last post by:
Hello, I have a div that has an overflow set to auto. I would like to know if the scrollbars are visible in javascript. Any help is appreciated. Thanks
1
by: elziko | last post by:
Is there any way of knowing if scrollbars have appeared in a control that has a ScrollableControl that has AutoScroll set to True? I have found this: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.