Click to See Complete Forum and Search --> : keeping window always on top of other window


DEVILSAN
11-24-2006, 03:40 PM
Hi friends, i am building a webpage that has a popup window which has a calculator in it. i want when any vistor click that link the popup window shud open and stay on top of all others & itself bring to focus on losing focus or if minimized it should restore itself. Please code me this in javascript i need it in hurry

tgreer
11-27-2006, 05:09 PM
Research the JavaScript "focus" and "blur" events. As an editorial comment, this is a very bad idea as it violates the User Model (the user's expectations of control and site operation). Also, demanding that anonymous members code things for you is generally not the best way to ask for assistance.

DEVILSAN
11-27-2006, 05:30 PM
well i just needed an idea... to implement a small window that stays on top of other or that particular parent window so as it can be used when required.

tgreer
11-27-2006, 05:32 PM
I understand. My idea is that you should research "focus" and "blur". Have you done so? If so, do you have any questions? If not, why not?

DEVILSAN
11-27-2006, 06:25 PM
well what are the function for body..

function func(){
//document.forms[0][0].focus();
$(a_field_id).focus()
//alert("Body just lost focus.");
}

</script>
</head>
<body id="myB" onBlur="func()">

i am trying like this but this is giving error

tgreer
11-28-2006, 09:43 AM
I'm sorry, not having telepathic powers, it would help if you posted the error. I don't know what doctype you are using, either, so cannot comment on the syntax within the function. A function hardly seems necessary, though:

<body onblur="self.focus();">

Again, you should rarely, if ever, attempt to circumvent user control. If I browse to a site, and the window I select doesn't get focus, it would be my last trip to that site.

DEVILSAN
11-28-2006, 03:25 PM
i am using <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

but <body onblur="self.focus();"> solves the purpose.. what i wanted.

Like you said If I browse to a site, and the window I select doesn't get focus,

if this is a small popup window this works but have problem with the windows 95 & windows 98 ...

Thanks for the help.. seems like u dont require tellepatic powers or u have to get back :lol: he he