Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: Page Dimensions

  1. #1
    New Coder
    Join Date
    Nov 2005
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Page Dimensions

    Hi to all on these wonderful forums..

    This is kind of embarrassing - I have no idea where to put this question because I have no idea what language would be the best to solve to problem hehe..

    Okay.. the problem:

    A lot of people doesn't maximize their browser, and even more people keep their "Favourites" open while surfing.. Now, I have noticed that many pages (for example CodingForums.com ) change their dimensions when you enable / disable the "Favourites"-thingy.....how can I make my page do that?

    And what language would be the best to do it in? .. I would prefer JavaScript or PHP if possible ...well... HTML if possible too

    Thanks for all the help

    //deaf_digit

  • #2
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There's not really a code to do that.... Coding Forums uses a fluid layout, meaning that it resizes to whatever size the window is. You just need to specify widths in percentages.

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,639
    Thanks
    0
    Thanked 649 Times in 639 Posts
    The following Javascript functions will tell you how much of your page is visible (useful for substituting different sized images etc.)

    Code:
    function pageWidth() {return window.innerWidth != null? window.innerWidth: document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth:document.body != null? document.body.clientWidth:null;}
    function pageHeight() {return window.innerHeight != null? window.innerHeight: document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight:document.body != null? document.body.clientHeight:null;}
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #4
    New Coder
    Join Date
    Nov 2005
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hmm... I see.. well I'll try and work something out.. thanks for the help

  • #5
    New Coder
    Join Date
    Nov 2005
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hmm... fluid layout you say? .. hmm.. how would you turn something like this code into fluid?

    Code:
    .content {
    	position: relative; 
    	width: 640px;
    	min-width: 150px;
    	margin-top: -52px;
    	margin-right: 0px;
    	margin-bottom: 61px;
    	margin-left: 160px;
    	border: 1px solid #000;
    	background-color: #e0eeee;
    	padding: 10px;
    	z-index: 4;
    	}

    or... hmm.. perhaps it is this code that needs to be changed..:

    Code:
    body {
    	margin-top: 60px; /* take care - if changed - all boxpositions must be changed too */
    	margin-right: 10px;
    	margin-bottom: 10px;
    	margin-left: 10px;
    	border: 0 none; /*	border: 1px solid #fff;  for proof only - if - box-positions will change */
    	padding: 0px;
    	background-color: #ccccff;
    	color: #555;
    	font-size: 10px;
    	line-height: 16px;
    	font-family: Verdana, Geneva, Helvetica, Arial, sans-serif;
    	z-index: 1;
    	}
    or the "<div>" perhaps?

    Please help


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •