www.webdeveloper.com
Results 1 to 5 of 5

Thread: JavaScript to make browser window stay on bottom not on top

  1. #1
    Join Date
    Oct 2012
    Posts
    3

    Post JavaScript to make browser window stay on bottom not on top

    I hope someone can help me with this problem. I can manage to find JavaScript to make a window stay on top but not on the bottom. Is it possible to have a browser window remain the bottom window no matter what? Any help is appreciated. Thank you.

  2. #2
    Join Date
    Sep 2011
    Location
    Bristol, England, United Kingdom
    Posts
    192
    Your question isn't very easy to understand. What exactly do you mean by "make a window stay on top but not on the bottom"?

    Do you mean you want the actual window to be fixed in a given position? If so, this is not possible in JavaScript and requires some programming in the Win32 API, since it involves manipulating the local machine.

    If you mean you want the window to "stay at the top", as in make the window un-scrollable, this is possible with JavaScript by simply using:

    Code:
    window.addEventListener("scroll", function(){return false;}, false);
    Edit it may also be:
    Code:
    window.addEventListener("scroll", function(event){event.stopPropagation();}, false);
    Please be more specific.
    Last edited by George88; 10-31-2012 at 05:08 PM.

  3. #3
    Join Date
    Oct 2012
    Posts
    3
    Hello. Sorry about that. I need a website to remain in the bottom window always. Once a button is clicked a pop up window is opened and I do not want the pop up window to go behind the parent window. I do not control the content in the pop up window so I cannot add script to it to make it stay on top.

    Is there a JavaScript that can do that, or something I can add to the HTML body tag possibly?

  4. #4
    Join Date
    Aug 2008
    Location
    Sweden
    Posts
    227
    No you can't force a window to stay above or below another window.

  5. #5
    Join Date
    Oct 2012
    Posts
    3
    Quote Originally Posted by refreezed View Post
    No you can't force a window to stay above or below another window.
    You can make the browser window stay on top:

    <script language="JavaScript">
    if (top != self)
    { top.location = location;
    }
    </script>

    OR

    <body onBlur="self.focus()">

    I need the exact opposite of those..

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles