/    Sign up×
Community /Pin to ProfileBookmark

Disabling the Close Button of the WINDOW

Plzzz anyone help me regarding the disabling of close button(X) of the window.
Now dont say tht its not possible as i have seen web site windows where the maximise button is disabled(eg:[url]WWW.idbiindia.com,lick[/url] login and see the pop up window)
Now this is a big problem..Can any one solve this??? ?

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@konithomimoOct 25.2005 — I believe you asked this a while back, and the answer is still that IT IS NOT POSSIBLE!!! Browsers allow us to control the maximize and minimize buttons, but not the close(exit) button. A website is not supposed to be able to prevent people from leaving. There is a big difference in not allowing people to change the size of the window (since that can affect the display of the site) and not allowing people to leave.

That being said, I will repeat what we told you last time.There are a few ways to hide/prevent the close button from loading, but they only work for IE. Since you are asking for IE, here is the easiest way:
<i>
</i>&lt;script language="JavaScript" type="text/javascript"&gt;
&lt;!--
var w = window.open('http://www.yahoo.com/','','fullscreen=yes');
// --&gt;
&lt;/script&gt;

For that method the relevant parameter is fullscreen. A window in fullscreen has no title bar. If the document displayed in the popup shall not appear fullscreen (but still without title bar) then you can use the resizeTo command to make it smaller.

[SIZE=4]Note-* You can do this through DHTML by using layers and covering up the titlebar (or part of it), but the titlebar isnt really gone. It will just be hidden. (this works in most browsers) That will be what you usually see because you can create your own image to place over the titlebar so that it apperas that the titlebar is still there, or you can make it transparent, which means that the user can see the titlebar but cannot access it.[/SIZE]
Copy linkTweet thisAlerts:
@DhanusauthorOct 27.2005 — Guys..I have found out the answer myself....

there is as pecial window known as the chromeless window...which is created by the user..so by doin this the user can themself hide or disable the close button or anything.....
Copy linkTweet thisAlerts:
@konithomimoOct 27.2005 — Which is pointless, because if you want to disable the close button when your site is loaded then allowing the user to control it is pointless . . . the only real way to prevent a user from accesing it is with dhtml.

There are only 3 times that I can see this being useful:

  • 1. You are trying to make your site look like a stand alone program.

  • 2. You have an online game that you want people to be able to make "fullscreen"

  • 3. You have video/slideshow files that you want to display "fullscreen"

    (seeing how some people don't like having the edges there when doing the last two things)


  • However, from preveious threads started by you, your desire is "Showing a popup with only "OK" button [SIZE=4]which doesnt allow the user to close the window[/SIZE]"

    Notice the part in large type . . . allowing the user to choose to remove the title bar, menus, or scroll bars does not do what you asked for.
    Copy linkTweet thisAlerts:
    @felgallOct 28.2005 — The only way to create a window that doesn't have a close button is to create it using DHTML as a layer over the top of the current browser window contents. Of course that still won't stop your visitor closing the browser or navigating to a different page but it will stop them doing anything more with your page until they finishe with the overlaid page.
    Copy linkTweet thisAlerts:
    @konithomimoOct 29.2005 — I have tried explaing that to him more than once, but he refuses to listen . . . oh well, that just means he has to compromise or have more headaches than are necessary.
    ×

    Success!

    Help @Dhanus spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.17,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @nearjob,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...