473,657 Members | 2,515 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

overflow:auto issue in XHTML standards mode

I have a webpage that has 2 main DIVs - a title div and a content div.
I want the title dive to always "stick to the top of the page and

not scroll, regardless of the size of the window. The content div
should have a scrollbar that sits underneath the title div. I have

some event handlers in Javascript that handle calculating the size of
the content div.

Everything works fine in IE/Firefox when I remove the DTD from my
document (quirks mode) but in standards mode I get the scrollbar for
the

whole window and both the content div and title div scroll. The code
is below. If you comment out the DOCTYPE line to render in qirks

mode you will see the behavior I want.

So my question is: how can I get this page to appear the same way in
standards mode and quirks mode?

Any help on this is greatly appreciated.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>Ti tle</title>

<style type="text/css">
.contentBody
{
font-weight: normal;
font-size: 10pt;
margin: 0px;
color: #000000;
font-style: normal;
font-family: Arial, Helvetica, sans-serif;
background-color: #ffffff
}
</style>

<script type="text/javascript">
function Init()
{
if (window.addEven tListener)
{
// Mozilla/W3C
window.addEvent Listener('load' , handleResize, false);
window.addEvent Listener('resiz e', handleResize, false);
}
else if (window.attachE vent)
{
// IE
window.attachEv ent('onload', handleResize);
window.attachEv ent('onresize', handleResize);
}
}

function handleResize()
{
try {
var e = document.getEle mentById("eCont entDiv");
e.style.height = document.body.c lientHeight - eContentDiv.off setTop
+ "px";
e.style.width = document.body.c lientWidth + "px" ;
}
catch ( ex ) {
/**/
}
}
</script>

</head>
<body class="contentB ody" onload="Init(); ">

<form method="post" action="test.ht ml" id="frmMain">

<!-- banner -->
<div class="contentT itleBar" style="backgrou nd-color:#000099;
color:#FFFFFF; height:32px; width:100%; overflow:hidden ;">
<b>Title Content</b>
</div>

<!-- The Content DIV -->
<div id="eContentDiv " style="overflow :auto; width:100%;">
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
Content<br />
</div>
</form>

</body>
</html>

Oct 11 '06 #1
2 2526
On 2006-10-11, ka******@hotmai l.com <ka******@hotma il.comwrote:
I have a webpage that has 2 main DIVs - a title div and a content div.
I want the title dive to always "stick to the top of the page and

not scroll, regardless of the size of the window. The content div
should have a scrollbar that sits underneath the title div. I have

some event handlers in Javascript that handle calculating the size of
the content div.

Everything works fine in IE/Firefox when I remove the DTD from my
document (quirks mode) but in standards mode I get the scrollbar for
the

whole window and both the content div and title div scroll. The code
is below. If you comment out the DOCTYPE line to render in qirks

mode you will see the behavior I want.

So my question is: how can I get this page to appear the same way in
standards mode and quirks mode?

Any help on this is greatly appreciated.
[snip]
var e = document.getEle mentById("eCont entDiv");
e.style.height = document.body.c lientHeight -
eContentDiv.off setTop
^^^^^^^^^^^

Here you mean "e" I think. eContentDiv is not the name of any variable.

As for the problem, I think it may be related to
document.body.c lientHeight which is non-standard.

Possibly window.getCompu tedStyle() is the proper one to use.
Oct 11 '06 #2
Scripsit ka******@hotmai l.com:
I have a webpage that has 2 main DIVs - a title div and a content div.
So you multiposted, in addition to not posting the URL. Constructive
discussion on your problem ended before it started.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Oct 11 '06 #3

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

Similar topics

2
6365
by: matthewmacchia | last post by:
I believe this is a Firefox bug but I was hoping someone found a workaround. I have implemented drag and drop functionality, but if I try to drag an element from a div that happens to have a div with an "overflow: auto" it seems to lose the onmouseover event for my target. Anyone come across this issue and found a resolution? Please advise. Here is a link to my code.
4
23251
by: Harry | last post by:
I just implemented an "overflow: auto" for a div in the main message window: http://www.auriance.com/docs/interaction/ This works as expected in Internet Explorer and Opera, but in Firefox it doesn't. There shouldn't be a scrollbar on the page, but instead, on the div that shows the messages. Any idea? Thanks,
1
4048
by: Jefferds.A | last post by:
Hi, I'm putting together a little database of individuals categorized by family. I have two lists, one that contains family names and one that contains individuals' names. When you click on a link in the first list, it generates from a mysql database all the people associated with that family. When you click on an individual's name, it displays biographical information. The catch is, for space, I've put these lists in little boxes...
4
12525
by: reycri | last post by:
I have a page that works as I intend in IE but not in Firefox: <html> <head> <title>Overflow Test</title> </head> <body style='overflow:hidden; margin:0; padding:0;'> <table border='0' cellpadding='0' cellspacing='0' style='border-collapse:collapse; width:100%; height:100%;'> <tr><td colspan='2' style='height:3em; border-bottom:1px solid
2
1793
by: kaczmar2 | last post by:
I have a webpage that has 2 main DIVs - a title div and a content div. I want the title dive to always "stick to the top of the page and not scroll, regardless of the size of the window. The content div should have a scrollbar that sits underneath the title div. I have some event handlers in Javascript that handle calculating the size of the content div. Everything works fine in IE/Firefox when I remove the DTD from my
3
19071
by: Otto de Voogd | last post by:
I posted the problem below in alt.www.webmaster before, but no-one knew the answer, however someone suggested this group as a good place to ask. I am trying to fit images into a browser window using CSS and in particular overflow:auto; The idea being that if a user's window is too small the image becomes scrollable (horizontally) and a horizontal scrollbar appears. It works nicely in Firefox and Opera but with Internet Explorer 7 a...
5
13364
by: vunet.us | last post by:
How can I hide scrollbars which appear in my floating div element with CSS property overflow:auto? I do need to use auto overflow. Thank you.
14
14271
by: MrPutty | last post by:
Hello everyone! It seems I've finaly found a place with savy folks ;-) The following problem has me puzzeled - hopefully someone can help me out! ------------------------------------------------ - head - ------------------------------------------------ - - - - m - - - e - -
1
1833
by: Jake Barnes | last post by:
I searched comp.lang.javascript on Google Groups but I didn't find an answer when I searched for "viewport" or "viewport div" or any combination of words using "viewport" so now I think I'm searching for the completely wrong thing. Perhaps someone can tell me what I should be searching for? I've got a div with overflow set to "auto": overflow:auto
4
5071
by: obanite | last post by:
Hi! I'm having issues with css in FF and IE regarding overflow: auto and font-size. If I have a div like this: <div style="overflow: auto"> <span>ipsumlorendictowhateveripsumlorendictowhateveripsumlorendictowhateveasdasdripsumlorendictowhateverasdasdasdjasjdioasjiosdjasiojdoasjisdojiasojdo </span> </div>
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8732
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1611
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.