asp选择显示图片问题
<divalign="center"><tableborder="1"width="500"style="border-collapse:collapse"id="tab...
<div align="center">
<table border="1" width="500" style="border-collapse: collapse" id="table1">
<tr>
<td width="48">
<form method="GET" name="aaa" action="index.asp">
<p><select size="1" name="D1">
<option>1</option>
<option>2</option>
</select></p>
</form>
<p> </td>
<td> </td>
</tr>
</table>
</div>
在左边选择1,在右边的单元格中会显示1.jpg的图片,在左边选择2,在右边的单元格中就会显示2.jpg的图片。。要求即时选择,即时变化,不需要提交后才变化。。望高手帮忙 展开
<table border="1" width="500" style="border-collapse: collapse" id="table1">
<tr>
<td width="48">
<form method="GET" name="aaa" action="index.asp">
<p><select size="1" name="D1">
<option>1</option>
<option>2</option>
</select></p>
</form>
<p> </td>
<td> </td>
</tr>
</table>
</div>
在左边选择1,在右边的单元格中会显示1.jpg的图片,在左边选择2,在右边的单元格中就会显示2.jpg的图片。。要求即时选择,即时变化,不需要提交后才变化。。望高手帮忙 展开
2个回答
展开全部
<div align="center">
<table border="1" width="500" style="border-collapse: collapse" id="table1">
<tr>
<td width="48">
<p><select size="1" name="D1" onChange="img1.src=this.value;">
<option selected value="1.jpg">1</option>
<option value="2.jpg">2</option>
</select></p>
</td>
<td><img src="1.jpg" name="img1" /></td>
</tr>
</table>
</div>
<table border="1" width="500" style="border-collapse: collapse" id="table1">
<tr>
<td width="48">
<p><select size="1" name="D1" onChange="img1.src=this.value;">
<option selected value="1.jpg">1</option>
<option value="2.jpg">2</option>
</select></p>
</td>
<td><img src="1.jpg" name="img1" /></td>
</tr>
</table>
</div>
展开全部
<html>
<head>
<script type="javascript/text">
function changes()
{
var x=document.getElementById("D1");
var index=x.selectedindex;
switch(index)
{
case 0: document.getElementById("ig1").src="./1.jpg";break;
case 1: document.getElementById("ig1").src="./2.jpg";break;
}
}
</script>
</head>
<body>
<div align="center">
<table border="1" width="500" style="border-collapse: collapse" id="table1">
<tr>
<td width="48">
<form method="GET" name="aaa" action="index.asp">
<p><select size="1" id="D1" onchange="changes()">
<option selected>1</option>
<option >2</option>
</select></p>
</form>
<p> </td>
<td>
<img src="1.jpg" id="ig1">
</td>
</tr>
</table>
</div>
</body></html>
<head>
<script type="javascript/text">
function changes()
{
var x=document.getElementById("D1");
var index=x.selectedindex;
switch(index)
{
case 0: document.getElementById("ig1").src="./1.jpg";break;
case 1: document.getElementById("ig1").src="./2.jpg";break;
}
}
</script>
</head>
<body>
<div align="center">
<table border="1" width="500" style="border-collapse: collapse" id="table1">
<tr>
<td width="48">
<form method="GET" name="aaa" action="index.asp">
<p><select size="1" id="D1" onchange="changes()">
<option selected>1</option>
<option >2</option>
</select></p>
</form>
<p> </td>
<td>
<img src="1.jpg" id="ig1">
</td>
</tr>
</table>
</div>
</body></html>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询