Click to See Complete Forum and Search --> : (value).mid


fuzz
12-12-2003, 05:09 PM
Im trying to make a dropdownmenu that opens a hidden frame with custom bgsound, any scripts for that?

heres what i tried (i dont know javascript well):

<SCRIPT LANGUAGE="JavaScript">
function openindex()
{
var OpenWindow=window.open("", "tttp","height=192,width=256");
OpenWindow.document.write("<body bgcolor='#3CA0CF'>")
OpenWindow.document.write("<bgsound loop=infinite src="(value).mid">")
OpenWindow.document.write("<img src='tttp.gif'>")
OpenWindow.document.write("<br>")
OpenWindow.document.write("<center><a href='javascript:self.close()' target='_self'>Close</a></center>")
}
</SCRIPT>

<form name="tttp">
<select style="font-size:12px;color:#006699;font-family:verdana;background-color:#ffffff;" name="menu" onChange="javascript:openindex()" target="_self" (document.tttp.menu.options[document.tttp.menu.selectedIndex].value);">
<option value="DD_SZ">Donald's Dock Street</option>
<option value="DD_SZ_activity">Donald's Dock Building</option>
</select>
</form>

Pittimann
12-13-2003, 01:12 AM
Hi!

Something like that will be what you have to adjust to your needs:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script language="JavaScript" type="text/javascript">
<!--
function openindex(val) {
if (val!=""){
var OpenWindow=window.open("", "tttp","height=192,width=256");
OpenWindow.document.write("<body bgcolor='#3CA0CF'>");
OpenWindow.document.write("<bgsound autostart=true loop=infinite src=\""+val+".mid\">");
OpenWindow.document.write("<img src='tttp.gif'>");
OpenWindow.document.write("<br>");
OpenWindow.document.write("<center><a href='javaXXscript:self.close()'>Close</a></center>");
}
}
//-->
</script>
</head>
<body>
<form name="tttp">
<select style="font-size:12px;color:#006699;font-family:verdana;background-color:#ffffff;" name="menu" onChange="javaXXscript:openindex(document.tttp.menu.options[document.tttp.menu.selectedIndex].value);">
<option value="">please select an option</option>
<option value="DD_SZ">Donald's Dock Street</option>
<option value="DD_SZ_activity">Donald's Dock Building</option>
</select>
</form>
</body>
</html>

Before playing with that code, please remove the red "XX"s appearing two times between "java" and "script" (make it one word)...

You should as well use the search function of these forums to collect more information on these "hidden frames" (popup windows)...

I added a blank option (without a value) to your dropdown to give the user a chance to select the first (now second) option without selecting the second one before.

Cheers - Pit

fuzz
12-13-2003, 05:21 PM
when clicking the menu the page open, but when u click again the page is added below the earlier, how do u refresh so u get a clean page?

pelegk1
12-14-2003, 03:08 AM
do :
javascript:window.refresh();

Pittimann
12-14-2003, 03:44 AM
Hi!

I think, I fixed your prob concerning how to pass the value vor the midi filename. Concerning the rest:

originally posted by myself:
You should as well use the search function of these forums to collect more information on these "hidden frames" (popup windows)... There are hundreds of threads where this popup stuff has already been dealt with. Using the search, you will find, what you need. You didn't search and now you complain, that there is something wrong...

Cheers - Pit