SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Is JS popup w*h different than of in pixel?

    hey folks,
    i been working on JS popup. not a JS fan but as i was working. i see that the values of JS height and width is not as same given by css in pixel. is it so? how can i balance both i.e if 300 is in Js, it should be in CSS too
    All those who wander aren't lost.

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,786
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    The width and height in a JavaScript window.open are the width and height in pixels of the entire new window. Once you deduct off the windows border, title bar, menu bar, address bar, toolbar, status bar etc you then get the viewport size of that window which is the part that the CSS can interact with.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    i didn't got you. well can u tell me in simple english. 200*300px how much it will be in JS. just a example
    All those who wander aren't lost.

  4. #4
    SitePoint Member
    Join Date
    May 2010
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How he explained it is pretty simple english to begin with, but here is what he said translated into Urdu if that helps

    ایک جاوا سکرپٹ window.open میں چوڑائی اور اونچائی مکمل نئی ونڈو کے پکسلز میں چوڑائی اور اونچائی ہیں. ایک بار آپ کو بند کھڑکیوں سرحد ، عنوان بار ، مینو بار ، ایڈریس بار ، ٹول بار کم کر دیتے ہیں ، درجہ بار وغیرہ آپ تو اس کھڑکی جس کا وہ حصہ جو سی ایس ایس کے ساتھ بات چیت کر سکتے ہیں کے ویو پورٹ لوڈ ملے.

  5. #5
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    @Madisonjs. lol thnx but i want a simple english but urdu. being in Pakistan doesn't mean i speak or understand urdu.lol
    All those who wander aren't lost.

  6. #6
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,786
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    The size you specify when opening a new window in JavaScript will be bigger by some amount than the area available in the viewport to display your page once you open it. There is no way of knowing how big the difference will be because you have no way of knowing how much space the toolbars etc will take up because that is controlled by the operating system. So all that can be determined is that the viewport will be smaller than the window.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

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