This is a migrated thread and some comments may be shown as answers.

How to detect scrollbar visibility

1 Answer 60 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 21 Jul 2011, 04:16 PM
Greetings,

I have an .aspx page that is loaded inside a radwindow. The content for the page is dynamic and of variable height.

In the Page_Load event, I want to detect if the vertical scrollbars for the window are visible, and if they appear, I want to restyle another div on the page. How do I detect if the scrollbars are visible in C# code-behind?


Thanks

1 Answer, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 21 Jul 2011, 05:58 PM
Hello Jon,

You can detect if scrollbars are visible in the code-behind unless you use javascript to store the value and cause another postback, just to perform the code-behind action.

I would suggest using jQuery to detect if you window is "overflowing" and  to resize your div.
Tags
Window
Asked by
Jon
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Share this question
or