Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

POPup and DISappear?

Posted on 2001-08-08
9
Medium Priority
?
315 Views
Last Modified: 2006-11-17
hi. i am in quick need of code that will create a pop up box, play a quick audio snippet, then disappear on its own.

*please* drop as much code and explanation as possible. i don't have anytime to spare on this project. THANKS!!
0
Comment
Question by:4ad
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 3

Expert Comment

by:nzjonboy
ID: 6366835
working on code

nzjonboy
0
 
LVL 3

Expert Comment

by:nzjonboy
ID: 6366844
here's some code for the first page

<html>
<head>
<script language="javascript">
     function soundPop() {
          sPop = window.open("soundPop.html","sPopup","left=300,top=250,width=300,height=10");
     }
</script>
</head>
<body>
<a href="javascript:soundPop()">Popup Sound</a>
</body>
</html>

here's code for the second

<html>
<body bgcolor="threedface">
<BGSOUND id="BGSOUND_ID" LOOP=1 SRC="sounds/Sound.wav">
</body>
</html>


the reason I have done it this way is becuase you cannot close a alert box with code. Still need sthe close function, I think the best way would be to have a timeout function in the second page that triggers after the length of the sound file.

hope this helps

nzjonboy
0
 
LVL 4

Accepted Solution

by:
ravi_raj123 earned 300 total points
ID: 6366966
HI,
nzjonboy's comment is ok but it wont disappear on its own.
Here is the modified code.


<html>
<head>
<script language="javascript">
function soundPop() {
closetime = 10; // Closes window after 10 seconds
                // 0 = do not close
sPop = window.open("soundPop.html","sPopup","left=300,top=250,width=300,height=10,addressbar=no, statusbar=no,menubar=no,scrollbar=no");

if (closetime) setTimeout("sPop.close();", closetime*1000);

}
</script>
</head>
<body>
<a href="javascript:soundPop()">Popup Sound</a>
</body>
</html>

here's code for the second

<html>
<body bgcolor="threedface">
<BGSOUND id="BGSOUND_ID" LOOP=1 SRC="sounds/Sound.wav">
</body>
</html>

GOOD LUCK...:)
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 3

Expert Comment

by:nzjonboy
ID: 6367065
looks like ravi_raj123 has coded what I suggested at the bottom of my earlier post.

nzjonboy
0
 
LVL 4

Expert Comment

by:ravi_raj123
ID: 6367076
yes nzjonboy, it was your code, but modified to suit for 4ad's question.
0
 

Author Comment

by:4ad
ID: 6373062
ok, thanks. i'm still working with it right now.
0
 
LVL 3

Expert Comment

by:nzjonboy
ID: 6386172
any up date for us 4ad?

nzjonboy
0
 

Author Comment

by:4ad
ID: 6426490
hi, sorry so late to reply.

a modification request...instead of a link they click to open the box, how can I do it where, right when the homepage loads, the box opens itself automatically?

thanks very much!
0
 
LVL 4

Expert Comment

by:ravi_raj123
ID: 6427609
write this......

<body onLoad="soundPop()">

it will opens popup window when the page loads.

Good Luck...:)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
This article discusses how to create an extensible mechanism for linked drop downs.
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

604 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