Forum Moderators: not2easy

Message Too Old, No Replies

Overflow: hidden; on body, html

         

Sathallrin

4:25 pm on Jun 16, 2005 (gmt 0)

10+ Year Member



I am trying to use the overflow: hidden property on the body and html.

html,body {
height:100%;
width:100%;
overflow:hidden;
}

This causes everything that is displayed outside of the main window to not show, and scrollbars to not show up for it.
In this example: <SNIP> Normally, you can still middle click and scroll by moving the mouse, I have disabled this on IE by putting a div that takes up the whole window. As middle clicking on divs in IE does nothing. In FireFox I could always disable middle click with javascript, but I haven't put that in the example.

I have 2 boxes which extend the limits of the window... it works great on IE with what I have. But in firefox. If you highlight the text and then drag the mouse out of the window while still holding down the button. It scrolls to the right or down.

Would anyone know of a way to workaround the autoscrolling when highlighting. IE does not cause this problem for me.

[edited by: BlobFisk at 5:04 pm (utc) on June 16, 2005]
[edit reason] No URLs please! See TOS [webmasterworld.com] [/edit]

Sathallrin

5:27 pm on Jun 16, 2005 (gmt 0)

10+ Year Member



Since my example link was removed, here is the code to the example page.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<title>testpage</title>
<style type="text/css">
html,body {
height:100%;
width:100%;
overflow:hidden;
}
</style>
</head>
<body leftMargin="0" topMargin="0" marginheight="0" marginwidth="0">
<div style="height:100%;width=100%;"></div>
<div id="testbox" style="position:absolute;top:10px;left:300px;width:1000px;height:100px;background:blue;">
hello
</div>
<div id="testbox2" style="position:absolute;top:300px;left:300px;width:100px;height:1000px;background:blue;">
world
</div>
</body>
</html>

createErrorMsg

2:55 pm on Jun 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



anyone know of a way to workaround the autoscrolling when highlighting

Given FF's commitment to standards adherence, and what that standards adherence means for accessibility, I'm guessing there's no way to make FF lock content completely away from the users grasp. Truth be told, I can't think of a reason why you would want to have part of your content area off screen, but inaccessible. Perhaps you can tell us something about what you want to use this for; we may be able to think of another approach to meet your needs.

FYI, FF also allows the content in your example to scroll with the mouse wheel.

cEM

Sathallrin

3:06 pm on Jun 17, 2005 (gmt 0)

10+ Year Member



Basically, the reason I am trying this is I have content on my page which the user is able to click on and drag around.

With firefox, they are able to drag it so part of it is off the right of side the screen (so it is out of the main content window). After doing this, firefox allows them to scroll over off the page, which is not my desired effect.

I have thought of restricting the movement so it cannot go past the right border of the screen, but I would like it to be able to dragged so it is partly on and partly off (hidden).