PDA

View Full Version : Links with Description Help



Agent Moose
12-06-2006, 09:20 PM
I am trying to put the Drop-down Menu thing with Descriptions in a Table. I have the table with three Columns...If you go Here (http://z11.invisionfree.com/MCtest/index.php?http://s11.invisionfree.com/MCtest/) You can see what I am trying to do at the bottom of that page. All I need to add is the Catagory part. How would I do that?

Here is the code I am useing...I haven't changed any thing with it yet...

<!--MC Radio V2(Shorty)-->
<div class="tableborder"> <div class='maintitle' align='left'>Active Radio X</a></div> <table border="0" cellspacing="1" cellpadding="4"> <tr> <th align="center" width="23%" class='titlemedium'>Station</th> <th align="center" width="32%" class='titlemedium'>Description</th> <th align="center" width="20%" class='titlemedium'><center>Genre</center></th> </tr> <tr> <td class="row4" align="center">


<b>Listen to </b><form name="form1">
<select name="select1" size="1" onChange="displaydesc(document.form1.select1, thetext1, 'textcontainer1')">
<option selected value="http://www.1club.fm/clubfm_media/v42.aspx?station=activex" target="newwin">Active Radio X</option>
<option value="http://www.1club.fm/clubfm_media/v42.aspx?station=modernrock" target="newwin">Modern Rock</option>
<option value="http://www.1club.fm/clubfm_media/v42.aspx?station=classicrock" target="newwin">102 Rock</option>
<option value="http://www.1club.fm/clubfm_media/v42.aspx?station=hairband">Hair Band Rock</option>
<option value="http://www.1club.fm/clubfm_media/v42.aspx?station=techno" target="newwin">Techno Club</option>
</select>
<input type="button" value="Listen"
onClick="jumptolink(document.form1.select1)">
</form>

</a></td> <td class="row4">
<span id="textcontainer1" align="left" style="font:italic 13px Arial">
</span>



<script type="text/javascript">
var thetext1=new Array()
thetext1[0]="A hard hitting Rock Channel playing the best in Heavy Metal, Alternative, and 80s Hard Rock on the planet."
thetext1[1]="The Net's New Rock Alternative. An edgy display of Active, Modern, Today & Classic Alternative Rock Music."
thetext1[2]="LIVE from a City that built the Classic Rock format. Take a listen to the legendary bands that started it all."
thetext1[3]="The House of Hair Spray and Spandex. Playing your favorite sleaze Rock Anthems of the 80s & early 90s!"
thetext1[4]="Spinning the best in Trance and Techno Club Beats. Live from Chicago, it's the net's home for the best in underground sounds!"
</script>


<br /></td> <td class="row2" align="center">

<script type="text/javascript">
function displaydesc(which, descriptionarray, container){
if (document.getElementById)
document.getElementById(container).innerHTML=descriptionarray[which.selectedIndex]
}

function jumptolink(what){
var selectedopt=what.options[what.selectedIndex]
if (document.getElementById && selectedopt.getAttribute("target")=="newwin")
window.open(selectedopt.value)
else
window.location=selectedopt.value
}

displaydesc(document.form1.select1, thetext1, 'textcontainer1')

</script>

</td></table></div><br>
<!--End MC Radio V2(Shorty)-->

Also, How do I make it so that the window opens in this size:
width=747
height=462

I already tried adding it like this:

<option selected value="http://www.1club.fm/clubfm_media/v42.aspx?station=activex" target="newwin" width="747" height="462">Active Radio X</option>

ddadmin
12-07-2006, 07:10 AM
Warning: Please include a link to the DD script in question in your post. See this thread (http://www.dynamicdrive.com/forums/showthread.php?t=6) for the proper posting format when asking a question.

ddadmin
12-07-2006, 08:08 AM
FYI link to script on DD is here: http://www.dynamicdrive.com/dynamicindex1/combodescribe.htm

I'm not quite sure what you mean by the "Category part" not being added? To answer your second question, you'll need to find the line:


window.open(selectedopt.value)

and change that to:


window.open(selectedopt.value, "", "width=747px, height=462px")

See the bottom of this page (http://www.javascriptkit.com/jsref/window.shtml) for additional window attributes you can use.

Agent Moose
12-08-2006, 02:25 AM
The catagory part, I ment genre, but yea. There are three columns in the table I made. The first one is for the Drop-down menu, the second column is for the description, and the third is for the genre. I want the genre to be like the description, change with the option that the person chooses. Here is the code so maby you can figure out what I am talking about...


<!--MC Radio V2(Shorty)-->
<div class="tableborder"> <div class='maintitle' align='left'>MC Radio V2</a></div> <table border="0" cellspacing="1" cellpadding="4"> <tr> <th align="center" width="23%" class='titlemedium'>Station</th> <th align="center" width="32%" class='titlemedium'>Description</th> <th align="center" width="20%" class='titlemedium'><center>Genre</center></th> </tr> <tr> <td class="row4" align="center">


<b>Listen to </b><form name="form1">
<select name="station" size="1" onChange="displaydesc(document.form1.station, description, genre, 'textcontainer1')">
<option selected value="http://www.1club.fm/clubfm_media/v42.aspx?station=activex" target="newwin">Active Radio X</option>
<option value="http://www.1club.fm/clubfm_media/v42.aspx?station=modernrock" target="newwin">Modern Rock</option>
<option value="http://www.1club.fm/clubfm_media/v42.aspx?station=classicrock" target="newwin">102 Rock</option>
<option value="http://www.1club.fm/clubfm_media/v42.aspx?station=hairband">Hair Band Rock</option>
<option value="http://www.1club.fm/clubfm_media/v42.aspx?station=techno" target="newwin">Techno Club</option>
</select>
<input type="button" value="Listen"
onClick="jumptolink(document.form1.station)">
</form>

</a></td> <td class="row4">

<span id="textcontainer1" align="left" style="font:italic 13px Arial">
</span>
<script type="text/javascript">
var description=new Array()
description[0]="A hard hitting Rock Channel playing the best in Heavy Metal, Alternative, and 80s Hard Rock on the planet."
description[1]="The Net's New Rock Alternative. An edgy display of Active, Modern, Today & Classic Alternative Rock Music."
description[2]="LIVE from a City that built the Classic Rock format. Take a listen to the legendary bands that started it all."
description[3]="The House of Hair Spray and Spandex. Playing your favorite sleaze Rock Anthems of the 80s & early 90s!"
description[4]="Spinning the best in Trance and Techno Club Beats. Live from Chicago, it's the net's home for the best in underground sounds!"
</script>


<br /></td> <td class="row2" align="center">
<span id="textcontainer1" align="center" style="font:italic 13px Arial">
</span>
<script type="text/javascript">
var genre=new Array()
genre[0]="Rock"
genre[1]="Rock"
genre[2]="Rock"
genre[3]="Rock"
genre[4]="Techno"
</script>



<script type="text/javascript">
function displaydesc(which, descriptionarray, genrearray, container){
if (document.getElementById)
document.getElementById(container).innerHTML=descriptionarray[which.selectedIndex]
}

function jumptolink(what){
var selectedopt=what.options[what.selectedIndex]
if (document.getElementById && selectedopt.getAttribute("target")=="newwin")
window.open(selectedopt.value, "", "width=747px, height=462px")
else
window.location=selectedopt.value
}

displaydesc(document.form1.station, description, genre, 'textcontainer1')

</script>

</td></table></div><br>
<!--End MC Radio V2(Shorty)-->

Thanks if you can help.

Agent Moose
12-09-2006, 12:26 AM
I will make it easer for people to understand what I am saying.

How do I have a nother section that changes with the drop-down option like the description. Basicly, just add another description?