Results 1 to 3 of 3

Thread: How to read the width from your browser?

  1. #1
    Guest

    Talking

    How can i read the width from your document in your browser?
    I am using VbScript.

    Example:

    Code:
    Dim DocWidth
    
    DocWidth = Document.Width
    This doesnt work.




  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Here's a couple of Client-side javascript functions

    I never use client-side vb-script.

    Code:
    function docHeight() {   
    if (document.all) 
           return document.body.offsetHeight
        else if (document.layers)
           return document.body.document.height;
    
    }
    function docWidth() {   
    if (document.all) 
           return document.body.offsetWidth
        else if (document.layers)
           return document.body.document.width;
    
    }

  3. #3
    Guest

    Talking

    Thank you..

    Code:
    Const minwidth = 42
    
    function window_onresize()
      cmdNextPage.runtimeStyle.posWidth = _
        (document.body.offsetWidth - clng(minwidth))
    End function
    This was the one (document.body.offsetWidth) that i was looking for.

Posting Permissions

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



Click Here to Expand Forum to Full Width