Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 8th, 2004, 04:28 PM
Authorized User
 
Join Date: Nov 2004
Location: , , .
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default sizeable <div>

Hi everybody,

I'm doing a webpage where I have to put a huge amount of data in a table.I want to always keep showing the top menu. So what I do is a "little scrollable windows" for the data. The problem is that I want the page to don't have a scrollbar but expand as much as I can my data windows with its own scrollbar.

So here is my code to make my scrollable windows for my data



<style type="text/css">
    <!--
    div.scroll
    {
        height: 600px;
        width: 100%;
        overflow: auto;
        border: 1px solid #666;
        background-color: #ccc;
        padding: 1px;
    }
    -->
</style>


But the problem is that I can't choose a percentage for the height so is there a way to retrieve the windows size and adjust the data windows from there??


Thank you very much

Reply With Quote
  #2 (permalink)  
Old December 8th, 2004, 08:28 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hiii johnjohn,
yes you can get the window size
*** for IE*****
//document.body.clientWidth;
//document.body.clientHeight;
*** for NS*****

//innerWidth;
//innerHeight;


<script>
function AdjustScreen()
{
obj=document.getElementById("divid")
obj.style.width=document.body.clientWidth-100
//alert(document.body.clientWidth);
//if you want you can also manipulate obj.style.height
}
window.onresize = AdjustScreen
</script>
<div id="divid" style="overflow: auto; width: 168px; height: 420px;">
<table border=1 width=100%>
<tr><td>Name</td><td>Name1</td><td>Name2</td><td>Name3</td><td>Name4</td></tr>
<tr><td>Name1</td><td>Name11</td><td>Name21</td><td>Name13</td><td>Name14</td></tr>
</table></div>

Well i haven't tested for NS
Hope this will help you

Cheers :)

vinod
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript with <div> aware Javascript How-To 3 August 25th, 2005 05:57 AM
hide the <div> crmpicco Javascript How-To 1 August 22nd, 2005 09:43 PM
<style> tags in a <body> vs. <div> bcat BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 March 27th, 2005 08:50 AM
scrolling <DIV> anshul Javascript How-To 12 August 4th, 2004 09:51 AM
<A><DIV><TABLE></DIV></A> anshul HTML Code Clinic 2 July 17th, 2004 02:17 PM



All times are GMT -4. The time now is 03:01 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.