Hey folks,
First off, let me describe the situation briefly:
I'm building a float-based layout with a kind of Q & A format. Part of it consists of a containing div inside which is a nested Question div. A second nested div within the containing div holds the answer. This is set to display: none. If the user hovers over the question, the answer div is activated by :hover and using z-index, both elements are displayed. A fairly typical CSS based 'dropdown panel' effect. So far so good.
The problem:
The z-index panel containing the Answer element sets up its own scroll bar if it crosses the limit (bottom) of the visible screen. You can scroll down the panel and the page behaves as you would expect i.e it all scrolls. But the moment you lose mouse focus on the panel and switch back to the main page, the screen jumps quite a few px, as if the main page scrolling and the panel scrolling are offset from one another. I really can't see a logical reason for this (all code validates and the margins/padding for elements within the container are pretty much identical - one stacks right on top of the other)
Has anyone dealt with this or something like it? Any thoughts would be useful.
Cheers
Jason
First off, let me describe the situation briefly:
I'm building a float-based layout with a kind of Q & A format. Part of it consists of a containing div inside which is a nested Question div. A second nested div within the containing div holds the answer. This is set to display: none. If the user hovers over the question, the answer div is activated by :hover and using z-index, both elements are displayed. A fairly typical CSS based 'dropdown panel' effect. So far so good.
The problem:
The z-index panel containing the Answer element sets up its own scroll bar if it crosses the limit (bottom) of the visible screen. You can scroll down the panel and the page behaves as you would expect i.e it all scrolls. But the moment you lose mouse focus on the panel and switch back to the main page, the screen jumps quite a few px, as if the main page scrolling and the panel scrolling are offset from one another. I really can't see a logical reason for this (all code validates and the margins/padding for elements within the container are pretty much identical - one stacks right on top of the other)
Has anyone dealt with this or something like it? Any thoughts would be useful.
Cheers
Jason

Help
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Back to top








