SitePoint Sponsor

User Tag List

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

    how to do if condition depending on screen Rs

    Hey folks,
    i m crearting a pop with some parameters like locationbar,statusbar=no and its height and width 1280*800. but originally i have given its hight to be 699 to pixel a viewpoint. however i need help with someone who has a less resolution. can i put some if condition. checking if the resolution isn't at 1280 * 800 and if so than the popup should have scroll. is there anymore smater way to handle this? as of now if someone has a less Res. everything get clipped off
    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)
    You can use screen.width and screen.height to get the actual screen resolution but that doesn't take into account any fixed toolbars displayed on the screen.

    You can't turn off the locationbar or status bar in modern browsers so the actual space you will have available in the window may be less than you expect.
    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)
    yes i saw that, but given my scanerio i.e if a person is using less Resoultion than 1280 * 800. the scrollbar=yes whereas as of current they are no (leaving a person with with less resoultion not see the page beyond the viewpoint)
    All those who wander aren't lost.

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,682
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    The following gives you an idea of how to do it.

    Code javascript:
    var useScrollbar = (screen.height < 800) ? 'yes' : 'no';
    window.open(..., ..., 'scrollbar='+useScrollbar,...');
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  5. #5
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    well i m totally new to JS. for now what i m using is
    Code JavaScript:
    function Rezise(){
    window.open("home.php","_blank",toolbar=no,location=no,scrollbar=no,status=no,reziseable=no,fullscreen=yes,width=1280, height=800");
    having that said. those are bits and pieces i gathered from net to come up with what i want. adding to this your code. how will it be? i know i m being a nerd. but would appreciate your help
    All those who wander aren't lost.


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
  •