Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is there anything actually usefyl bout these commands?

Status
Not open for further replies.

estesflyer

Programmer
Dec 19, 2000
284
0
0
US
is there anything that these commands can do that is useful? who would wanna make a window be hidden, or come to front? am i missing something?
blur, focus
 
what im trying to ask, is what kind of scripts are these commands useful for? If you have an idea that you could use them w/ whatever, plz let me know
 
Well, sometimes you may have a pop up window which you use as a target for links on your page say. So when you clicka link you get some information popping up.

So, when you minimise it, it stays there, even when a new link is clicked, so the user may notrealise something has happened.

So you make it spring back up, so they can see it!
Also you can make the window always on top.

like onblur = focus, to stop it minimizing.


-Ben. "Alright whatever man, I'll hook up the hair, but I aint touchin the ring...Cause I'm still a pla--yer"
 
try this code to see the important of these commands.



<script language=&quot;javascript&quot;>

var newWin

function Do_open(site) {
if(!newWin||newWin.closed)
{newWin = window.open(site,&quot;&quot;,&quot;height=300,width=830,top=500,left=100,scrollbars=1,resizable=1&quot;)}
else if(!(newWin.closed))
{newWin.focus();}
}
</script>


<input type=&quot;button&quot; value=&quot;Microsoft.com&quot; onclick=&quot;Do_open(' false;&quot;>

Best regards
 
it's not only used for windows
for example, on a form, if an input isn't correct, you can focus on the field so the user won't scroll to it .. you can blur a field you want to be read only (ok that's not the proper way to do it, but it's an efficient one !) ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top