Solved

how to make windows appear?

Posted on 2000-04-11
8
228 Views
Last Modified: 2010-04-09
i want to know if anyone knows how to make small avertisment windows appear but after they appear make them minimize automatically.
0
Comment
Question by:fritolero
8 Comments
 

Expert Comment

by:Le_Ron
ID: 2704075
The JavaScript 'alert("string");' will show a little dialog box containing the text "string" with an OK button, but i don't know how to make it minimize automatically.

Example for a button :

<input type=button name="MyBtn" value="Push Me" onClick="alert('This is an warning')">

Or if you want to show it when the page is loaded :

<html>
<head>
<script>
function showMsg()
{
   alert("this is the message");
}
</script>
</head>
<body onLoad="showMsg()">
....
....
</body>
</html>

Hope this helps
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 2704419
This will open an add page:
 
<SCRIPT language='javascript'>
  var mywin=window.open("myAdd.html","myPopup","width=200,height=200");
</script>


Making it minimize, I don't know, but you can close it automatically like this:

mywin.close();
0
 
LVL 1

Expert Comment

by:Smacked
ID: 2706373
i think mywin.blur() will deselect the window
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 4

Expert Comment

by:rafistern
ID: 2706816
This
    onload="opener.focus()"
would focus the opening window
or
    onload="setTimeout('opener.focus()',5000)"
would focus the opening window after 5 seconds...
0
 
LVL 4

Expert Comment

by:rafistern
ID: 2706821
Also
    onload="window.resizeTo(0,0)"
will minimize in IE but will ignored by Netscape.
0
 

Expert Comment

by:drew_moffat
ID: 2717264
This is a little off topic, but for the browser detection part, try this link, it's pretty damn cool:

<http://www.dansteinman.com/dynduo/>

He is a god....heh

Drew
0
 

Expert Comment

by:drew_moffat
ID: 2717275
Damn, ignore that post, I thought I was in another question...sorry folks, but it's a cool link (sheepish grin)..

Drew
0
 
LVL 4

Accepted Solution

by:
dreamvb earned 500 total points
ID: 2766895
Only thing I can find that might be any good is this hope it helps

Put in Head

<script>
function winopen(){
        win = window.open("YOUR PAGE NAME", "newWin", "toolbar=yes,location=yes,directories=no,status=no, menubar=yes,scrollbars=yes,resizable=no,copyhistory=yes,width=400,height=260")
        startTime()
}

function startTime(){

        var time= new Date();
        hours= time.getHours();
        mins= time.getMinutes();
        secs= time.getSeconds();
        closeTime=hours*3600+mins*60+secs;
        closeTime+=3; // Amount of time that the window stays open in seconds
        Timer();

}

function Timer(){
        var time= new Date();
        hours= time.getHours();
        mins= time.getMinutes();
        secs= time.getSeconds();
        curTime=hours*3600+mins*60+secs
        if (curTime>=closeTime){
                if (win.closed == false){
                        win.close()}}
        else{
                window.setTimeout("Timer()",1000)}
}
</script>

and into the Body

onLoad="winopen()"

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Why a span is lower 2 26
Asp in script 6 37
removing a class in javascript 4 48
Html input text color the frame line 2 20
Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question