SQL PHP HTML ASP JavaScript articles and free scripts to download
JavaScript Events

window.blur()

We can lost focus from a window by using blur() method. Here is the syntax
window.blur();
Once the focus is lost then the window will be minimized ( not closed ) .
To get the window again we have to use window.focus()

Demo of window.blur and window focus method

You can see the source code of blur.htm
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<title>Demo of blur and focus of a window</title>
<script language=javascript>

function to_close(){
tm.close();
}

function to_open(){
tm=window.open("moveby-child.htm","Ratting","width=250,height=150,left=150,0,top=200,status=0,");
}


function to_focus(){
tm.focus();   // Keeping the focus on small window
}

function to_blur(){
tm.blur();   // Keeping the focus out on small window
}

</script>
</head>

<body>
<input type="button" name="btn" value="Open" onclick="to_open()";>
<input type="button" name="btn" value="Close" onclick="to_close()";>
<input type="button" name="btn" value="Focus" onclick="to_focus()";>
<input type="button" name="btn" value="Blur" onclick="to_blur()";>
</body>
</html>
The code for child window is available at moveBy

Be the first to post comment on this article :


Google+

Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked




HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us

©2000-2014 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer