sam said the following on 6/5/2006 7:19 PM:
Thats our product design, I have no choice to change the app design. To
be more clear.
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
Please don't top-post
I am trying to disable the browser scroll bar when ever a popup shows
up so that only popup is accessible. I tried using overflow: hidden
but it does not do what is required.
Ahh, now I think I understand. You are using an in-window dHTML pop-up
rather than the typical pop-up caused by window.open
The problem with overflow: hidden.
1) I have alenghty page, I scroll half way down and open a popup and my
popup is centered in the viewport, and now I should be able to disable
the scroll there so that the content in main window is visible but not
accessbile.
Find the top and left of your popup, use the window.onscroll to know
when the document gets scrolled, then use window.scrollTo to scroll back
to where you started.
You have to set a flag when the popup is displayed. When the window gets
scrolled, you check that flag. If a popup is showing, you don't allow
the scroll. If it is not showing, then you allow the scrolling.
var stopScroll = false;
var popupTop = 0;
window.onscroll = stopScrolling
function stopScrolling(){
if (stopScroll){
window.scrollTo(0,popupTop)
}
}
function showPopup(){
stopScroll = true;
popupTop = XXX
//XXX would be the top position of the
//popup window.
//rest of popup code here
}
function hidePopup(){
stopScroll = false;
//code here to hide the popup
}
That is a start, it will take more than that to do what you need to do
but it's a start.