PDA

View Full Version : Image selector II



prh108
05-08-2010, 12:09 PM
I would appreciate some assistance.

I want to use the above script on this site to list fabric, as there is a lot I wish to break the list alaphabetically.

Is it possisble to use the script more than once on a page, when I tried putting the script on twice it seemed to stop working.

If I can not, has anyone seen a script that could be used in this way

vwphillips
05-08-2010, 01:20 PM
presume you are refering to http://www.javascriptkit.com/script/cut174.shtml


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title></title>
<script language="javascript">


function showimage(sel,imgid){
var img=document.getElementById(imgid);
var s=sel.value.split('|')
img.src=s[0];
img.parentNode.href=s[1]||'#';
}

</script></head>

<body>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<form name="mygallery">
<p>
<select name="picture" size="1" onChange="showimage(this,'pictures')">
<option selected value="http://www.vicsjavascripts.org.uk/StdImages/One.gif|http://www.abcnews.com">Picture of me</option>
<option value="http://www.vicsjavascripts.org.uk/StdImages/Two.gif|http://www.cnn.com">Picture of my aunt</option>
<option value="http://www.vicsjavascripts.org.uk/StdImages/Three.gif|http://www.geocities.com">Picture of my brother</option>
</select></p>
<select name="picture" size="1" onChange="showimage(this,'pictures')">
<option selected value="http://www.vicsjavascripts.org.uk/StdImages/Four.gif|http://www.abcnews.com">Picture of me</option>
<option value="http://www.vicsjavascripts.org.uk/StdImages/Five.gif|http://www.cnn.com">Picture of my aunt</option>
<option value="http://www.vicsjavascripts.org.uk/StdImages/Six.gif|http://www.geocities.com">Picture of my brother</option>
</select></p>
</form>
</td>
</tr>
<tr>
<td width="100%"><p align="center"><a href="#" onMouseover="window.status='';return true"><img src="me.gif" id="pictures" width="99" height="100" border=0></a></td>
</tr>
</table>
</body>

</html>