Solved

how to make windows appear?

Posted on 2000-04-11
8
201 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
Comment Utility
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
Comment Utility
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
Comment Utility
i think mywin.blur() will deselect the window
0
 
LVL 4

Expert Comment

by:rafistern
Comment Utility
This
    onload="opener.focus()"
would focus the opening window
or
    onload="setTimeout('opener.focus()',5000)"
would focus the opening window after 5 seconds...
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 4

Expert Comment

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

Expert Comment

by:drew_moffat
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now