SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Feb 2003
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Controlling Appearance of Window

    I want to be able to control the appearance of a window ie:
    scrollbars, location, resize etc.

    But I want to do this from within the page itself, as with eg. window maximise scripts.

    All I can find are scripts for doing this by opening from another page.

    Can anyone help?

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2002
    Location
    Bristol, UK
    Posts
    2,240
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To resize a window you can use the following JavaScript:

    window.resizeTo(800,600);

    Changing the dimensions in brackets to the ones that you want.

    I'll find the CSS for changing scrollbars, hold on a sec

    -Sam
    Sam Hastings

  3. #3
    SitePoint Wizard
    Join Date
    Mar 2002
    Location
    Bristol, UK
    Posts
    2,240
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, here's how to change the scrollbars. Stick it in your Website's style sheet - it's part of the BODY definition thing (not too good on CSS vocab)

    scrollbar-3d-light-color: #C0C0C0;
    scrollbar-arrow-color: #333333;
    scrollbar-base-color: #999999;
    scrollbar-dark-shadow-color: #000000;
    scrollbar-face-color: #999999;
    scrollbar-highlight-color: #C0C0C0;
    scrollbar-shadow-color: #333333;

    Hope this helps [img]images/smilies/smile.gif[/img]

    -Sam
    Sam Hastings

  4. #4
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is currently no way available to affect the window 'features' ('grab' resize, toolbar, statusbar,...) from within a window.
    It can only be done when creating a (javascript popup) window.

    Scrollbars can be removed from a window by using css:

    Code:
    body {
    overflow: hidden;
    }
    It is advised that you only use this if you are 110% certain that the visible content will always fall within the user's window canvas area.
    (Certain css clipping methods can mean that larger divs can trigger window scrollbars whilst only a small section of the div is intentionally presented.)

    --

    I for one would love to see the kind of window feature control available to html windows that we get when creating popups.
    If we had access to these features then popups would not be as pervasive as they are today (amongst those who wish to present their sites in a very strict fashion.)
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  5. #5
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Bill Posters
    I for one would love to see the kind of window feature control available to html windows that we get when creating popups.
    If we had access to these features then popups would not be as pervasive as they are today (amongst those who wish to present their sites in a very strict fashion.)
    True, but I'm quite certain that will never happen (and doesn't exist now) because such capability would give the scripter too much control over the user's current window. I mean, if I'm browsing and all my toolbars and such got removed when I reached a page, I'd be upset. Then, when I left that page to another site, I'd have to turn them back on manually (which I might add, current browsers don't have menu toggles for 'scrollbars' or 'menubar'), assuming my menubar is still there. Or, I'd have to close that sessions and start over.

    I think it's best that we can't do that -- not because you or I would misuse it, but because somebody, inevitably, will.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  6. #6
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That' a very short-sighted exploration of the concept,beetle.

    The user problems you mention could be considered when devising the browser's method of handling the 'this-window' feature alterations. e.g. the features that are 'on' when entering a page can be logged to the browser and reinstated when leaving that domain or directory.
    I may be seeing things in over simple terms, but surely technology can present a solution that offers the author their chance to do it their way and the user the facilities to override it.

    Prevention could be handled in the same way that native popup blockers and Moz's preferential prevention of raising/lowering, moving, resizing, hiding the statusbar are implemented.

    That way it could be handled similarly to popups in that it would be something that is available to web authors, but preventable by web users.
    The popularity of this function (or backlash against it) could be the deciding factor as to whether it was a good idea to implement it on one's own site or not.
    Sites that use 'this-window' feature manipulation can be viewed/avoided in the same way that we view/avoid other sites that do things that we like/hate.


    I'm a great believer that all such 'author-oriented' features should be made possible and it should be left to users to prevent or accept them based on their individual preferences.

    But of course, this will never happen. The web has become a platform where the people whose opinion matters the least are the ones building the bloody thing- site authors.
    That's what happens when you let business models become the commanding principle. (I've never followed the mantra that 'the customer is always right'.)

    S'all very underwhelming.


    (at which point Bill stepped down from the soapbox and went and did something less boring instead.)
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  7. #7
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good point. But you're right, I still don't see it happening all too soon. Even an implementation such as you suggest seems too complicated for Joe Web Surfer.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev





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
  •