Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
You could build a function which changes the value of the <param> with a name="src" I believe...
If you put location of the "radio station" into the href="" of each link, you could stop the link from being followed and use its value to update the <param>
So let's say you wrap the linklist in an ID, called "radio-stations":
HTML Code:
<div id="radio-stations">
<a href="http://eradioportal.com/some-station.asx">Station 1</a>
<a href="http://eradioportal.com/some-station2.asx">Station 2</a>
<a href="http://eradioportal.com/some-station3.asx">Station 3</a>
</div>
Then, assuming there is only the one object on the page, you could stick this script down at the bottom or the page, right before the closing </body> tag:
Code:
<script type="text/javascript">
var a=document.getElementById("radio-stations").getElementsByTagName("a");
for(var i = 0; i < a.length; i++) {
a[i].onclick = function() {
var station = document.getElementsByTagName("object")[0];
station.data = this.href;
station.getElementsByName("src")[0].value = this.href;
return false; //stops link from being followed when clicked
}
}
</script>
I didn't test it, but if the value of the data attribute on the <object> and the value attribute of the <param> named "src" is what is controlling which station is being heard, something along these lines should work.
Last edited by wayfarer07; 01-14-2009 at 12:42 PM..
|