SitePoint Sponsor

User Tag List

Results 1 to 17 of 17
  1. #1
    SitePoint Addict
    Join Date
    Nov 2000
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi all, maybe someone here can help with this?

    I would like a script, that is page dependant, in that where ever a person comes to view the page, it will resize to the desired sizes and no tool bar, menu bar etc.

    For example: somebody submits a search query, and the template will have the code, to resize the window, or a confiramtion page holds the script, so it will be displayed in a small window.

    I have found and used this following script:

    <!-- full screen
    if (top.frames.length!=0)
    top.location=self.document.location;
    self.moveTo(0,0)
    self.resizeTo(screen.availWidth,screen.availHeight)
    //-->

    No matter where someone comes from, (search engine etc) this script will run, and open the window to full size I would like a similar script that will open the window to a specified size, and without tool bar, menu bar etc.

    With out being able to write my own scripts I can only rely on the expertise of others, and just edit to suit my own requirments.

    Thanks in advance to anyone that can help

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tex...have you tried:

    <!-- full screen
    if (top.frames.length!=0)
    top.location=self.document.location;
    self.moveTo(0,0)
    self.resizeTo(800,600)
    //-->

    Although regardless if that works or not I would recommend against doing what you are trying for.

    I personally HATE when a site tries to take over my screen, and I will typically close it without even looking at the information contained in it.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    SitePoint Addict
    Join Date
    Nov 2000
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice one creole, unfortunatly that doesn't work

    I understand what you're saying about the popup window being annoying and I do agree but the way I intend to use it will be creativly and not abusive or obstructive

    Please help

  4. #4
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    TexDread...try this one

    <script language="JavaScript">
    <!--

    function openWindow(page,name) {
    popupWin = window.open('status,scrollbars,width=250,height=350,left=550,top=50')
    }

    // -->

    Then you could call this function with the body tag

    <body onload="openWindow(yourpage.html,NameOfWindow">

    That would open a new window when that page was loaded, you could also toy with an additional script that would close the referring window with something like onBlur="window.close"
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  5. #5
    SitePoint Addict
    Join Date
    Nov 2000
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope This opens a new window to that size etc, and it really needs to resize its self onload.

    Did you try the script I posted?

    Thanks...

  6. #6
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tez....I just tried the script you listed, with the change I made using this code and it worked for me in IE 5 for the Mac

    <html>
    <head>
    <title>Untitled</title>

    <script type="javascript">
    <!-- full screen
    if (top.frames.length!=0)
    top.location=self.document.location;
    self.moveTo(0,0)
    self.resizeTo(800,600)
    //-->
    </script>

    </head>
    <body>

    </body>
    </html>


    That code resized the window to 800,600 and pusehd the window up to the Top corner of the screen.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  7. #7
    SitePoint Addict
    Join Date
    Nov 2000
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're absolutly right I don't know what I was doing wrong? Some baody also informed me that I could also use

    <script>
    window.resizeTo(800,600)
    </script>

    This will be better as it's shorter

    All are saying that there is no way of disabling the menu bar etc without it being a popup window, darn it

    "I Often Want The Imposible"

    Thanks again for your help, I wouldn't get far without the help of people and these forums

  8. #8
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    BULLSEYE!!!

    TexDread...this is the script that you are looking for. It tests out in IE 5 and NS 4.7 for the Mac (so I would assume that it would work for Windows)

    This page will open a new window (user specified) and then close the first window behind it.

    <html>
    <head>
    <title>Untitled</title>

    <script language="javascript">
    function popLink(Link){
    popup = window.open(Link,"newwin","height=200,width=300,scrollbars=no")
    }

    var timer = null
    function closeMe() {
    self.close()
    }

    //-->
    </script>
    </head>
    <body onLoad="javascript:onClick=(popLink('loadme.html')), timer=setTimeout('closeMe()',0000)"">
    </body>
    </html>


    It took me a little time to play with it, but I finally got it.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  9. #9
    SitePoint Addict
    Join Date
    Nov 2000
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's top! certainly gets around it, and with that window resize in the first window it works well.

    I am slowly getting to know a little javascript but not without the help people like you, it's all good

    Thanks again for your help creole....!

  10. #10
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    'twas my pleasure Tez
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  11. #11
    SitePoint Addict
    Join Date
    Oct 2000
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Creole, in IE anyway, that script will throw an annoying "This window is trying to close itself" box, if I read it right...?

  12. #12
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    etLux...when I assembled it, I thought that would happen too, but it does not. Don't know WHY it doesn't but it doesn't and so that is good enough for me.

    <added>
    etLux...I think the reason why it does not get an error is that I am using self.close instead of window.close. I could be wrong, but that seems to make sense to me.
    </added>



    <Edited by creole on 11-29-2000 at 10:35 AM>
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  13. #13
    SitePoint Addict
    Join Date
    Nov 2000
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    tis true, I also got the box about closing window with IE 5.5, wasn't to bothered though.

  14. #14
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    weird...it must be a
    Mac thing then. I never got the box about the window closing.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  15. #15
    SitePoint Addict
    Join Date
    Oct 2000
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey Creole.

    Just for the record... I tried the exact code (and a few variations) in IE on Windows. It always throws the alert.

    I've tried to get around this before, and never had any success in it. IE/Win appears to think it's a good idea to holler at you in this scenario -- and I can't say I entirely disagree.

    Say, for instance, you open a fullscreen mode window with no means of closing it, whilst closing the launch (parent) window; and the user is unaware that it can be closed with Alt-F4.

  16. #16
    SitePoint Member
    Join Date
    Dec 2000
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The 'annoying dialog' about the script trying to close the window will always come up in certain versions of IE when other pages have been browsed to other than the window's opener. If you tried opening a separate window with a "Close this window" button, you would have no problems.
    Brad Ediger
    Chief Programmer
    DynamixPro - Revolutionize Your Future
    http://www.dynamixpro.com/

  17. #17
    SitePoint Addict
    Join Date
    Oct 2000
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    "Child" windows (popups) *never* show the alert -- it's just when you try to call the "parent" to close that you'll get it.

    Not sure on how this works on Mac's -- haven't had a chance to check it -- but in Windows, it appears you always get this.



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
  •