asp select下拉菜单选择图标并实时显示
网络编程 2021-07-05 10:58www.168986.cn编程入门
直接在下拉菜单中的option选项中赋予路径,用asp循环输出
静态方法将狼蚁网站SEO优化的代码复制到<body>~</body>内
程序代码
<table cellpadding="2" width="226" cellspacing="2" border="0" >
<tr>
<td width="32" align="right"><img id=idface src="..../../../bbs/images/icon/1.gif" alt=个人形象代表 width="32" height="32"></td>
<td width="30" ><font class=cha2>头像</font></td>
<td width="69">
<select class=editbox1 onChange="document.images['idface'].src=options[selectedIndex].value;">
<option value=../../../bbs/images/icon/1.gif selected>头像1</option>
<option value=../../../bbs/images/icon/2.gif select>头像2</option>
<option value=../../../bbs/images/icon/3.gif select>头像3</option>
<option value=../../../bbs/images/icon/4.gif select>头像4</option>
<option value=../../../bbs/images/icon/5.gif select>头像5</option>
<option value=../../../bbs/images/icon/6.gif select>头像6</option>
<option value=../../../bbs/images/icon/7.gif select>头像7</option>
<option value=../../../bbs/images/icon/8.gif select>头像8</option>
<option value=../../../bbs/images/icon/9.gif select>头像9</option>
<option value=../../../bbs/images/icon/10.gif select>头像10</option>
<option value=../../../bbs/images/icon/11.gif select>头像11</option>
<option value=../../../bbs/images/icon/12.gif select>头像12</option>
<option value=../../../bbs/images/icon/13.gif select>头像13</option>
<option value=../../../bbs/images/icon/14.gif select>头像14</option>
<option value=../../../bbs/images/icon/15.gif select>头像15</option>
<option value=../../../bbs/images/icon/16.gif select>头像16</option>
<option value=../../../bbs/images/icon/17.gif select>头像17</option>
<option value=../../../bbs/images/icon/18.gif select>头像18</option>
<option value=../../../bbs/images/icon/19.gif select>头像19</option>
<option value=../../../bbs/images/icon/20.gif select>头像20</option>
</select>
</td>
<td width="69">--> 静态</td>
</tr>
</table>
ASP数组方法将狼蚁网站SEO优化的代码复制到<body>~</body>内
程序代码
<table cellpadding="2" width="241" cellspacing="2" border="0" >
<tr>
<td width="32" align="right"><img id=idface1 src="..../../../bbs/images/icon/1.gif" alt=个人形象代表 width="32" height="32"></td>
<td width="30" ><font class=cha2>头像</font></td>
<td width="62">
<select onChange="document.images['idface1'].src=options[selectedIndex].value;" class="editbox1" >
<%
dim i
for i=1 to 20
%>
<option select value="../../../bbs/images/icon/<%=I%>.gif">头像<%=I%></option>
<%
next
%>
</select>
</td>
<td width="91"> --> ASP 数组 </td>
</tr>
</table>
共同点
1、<img id=idface src="1.gif"> // 都必须在默认的图片上赋一个ID号
2、<select onChange="document.images['idface'].src=options[selectedIndex].value;"> // 再在下拉菜单中调用这个ID
......
</select>
不同点
在静态的制作方法中
程序代码
<select ......>
<option value=1.gif > 头像1 </option> // 直接在下拉菜单中的option选项中赋予路径
<option value=2.gif > 头像2 </option>
......
</select>
--------------------------------------------------------------------------------
在ASP数组 定义方法中
程序代码
<select ......>
<% dim i // 定义数组 i
for i=1 to 20 // 定义 i 的值为1~20
%>
<option select value="<%=I%>.gif">头像<%=I%></option> // 显示第一条选项的值
<% next %> // 下一条
</select>
程序代码
<table cellpadding="2" width="226" cellspacing="2" border="0" >
<tr>
<td width="32" align="right"><img id=idface src="..../../../bbs/images/icon/1.gif" alt=个人形象代表 width="32" height="32"></td>
<td width="30" ><font class=cha2>头像</font></td>
<td width="69">
<select class=editbox1 onChange="document.images['idface'].src=options[selectedIndex].value;">
<option value=../../../bbs/images/icon/1.gif selected>头像1</option>
<option value=../../../bbs/images/icon/2.gif select>头像2</option>
<option value=../../../bbs/images/icon/3.gif select>头像3</option>
<option value=../../../bbs/images/icon/4.gif select>头像4</option>
<option value=../../../bbs/images/icon/5.gif select>头像5</option>
<option value=../../../bbs/images/icon/6.gif select>头像6</option>
<option value=../../../bbs/images/icon/7.gif select>头像7</option>
<option value=../../../bbs/images/icon/8.gif select>头像8</option>
<option value=../../../bbs/images/icon/9.gif select>头像9</option>
<option value=../../../bbs/images/icon/10.gif select>头像10</option>
<option value=../../../bbs/images/icon/11.gif select>头像11</option>
<option value=../../../bbs/images/icon/12.gif select>头像12</option>
<option value=../../../bbs/images/icon/13.gif select>头像13</option>
<option value=../../../bbs/images/icon/14.gif select>头像14</option>
<option value=../../../bbs/images/icon/15.gif select>头像15</option>
<option value=../../../bbs/images/icon/16.gif select>头像16</option>
<option value=../../../bbs/images/icon/17.gif select>头像17</option>
<option value=../../../bbs/images/icon/18.gif select>头像18</option>
<option value=../../../bbs/images/icon/19.gif select>头像19</option>
<option value=../../../bbs/images/icon/20.gif select>头像20</option>
</select>
</td>
<td width="69">--> 静态</td>
</tr>
</table>
ASP数组方法将狼蚁网站SEO优化的代码复制到<body>~</body>内
程序代码
<table cellpadding="2" width="241" cellspacing="2" border="0" >
<tr>
<td width="32" align="right"><img id=idface1 src="..../../../bbs/images/icon/1.gif" alt=个人形象代表 width="32" height="32"></td>
<td width="30" ><font class=cha2>头像</font></td>
<td width="62">
<select onChange="document.images['idface1'].src=options[selectedIndex].value;" class="editbox1" >
<%
dim i
for i=1 to 20
%>
<option select value="../../../bbs/images/icon/<%=I%>.gif">头像<%=I%></option>
<%
next
%>
</select>
</td>
<td width="91"> --> ASP 数组 </td>
</tr>
</table>
共同点
1、<img id=idface src="1.gif"> // 都必须在默认的图片上赋一个ID号
2、<select onChange="document.images['idface'].src=options[selectedIndex].value;"> // 再在下拉菜单中调用这个ID
......
</select>
不同点
在静态的制作方法中
程序代码
<select ......>
<option value=1.gif > 头像1 </option> // 直接在下拉菜单中的option选项中赋予路径
<option value=2.gif > 头像2 </option>
......
</select>
--------------------------------------------------------------------------------
在ASP数组 定义方法中
程序代码
<select ......>
<% dim i // 定义数组 i
for i=1 to 20 // 定义 i 的值为1~20
%>
<option select value="<%=I%>.gif">头像<%=I%></option> // 显示第一条选项的值
<% next %> // 下一条
</select>
编程语言
- 如何快速学会编程 如何快速学会ug编程
- 免费学编程的app 推荐12个免费学编程的好网站
- 电脑怎么编程:电脑怎么编程网咯游戏菜单图标
- 如何写代码新手教学 如何写代码新手教学手机
- 基础编程入门教程视频 基础编程入门教程视频华
- 编程演示:编程演示浦丰投针过程
- 乐高编程加盟 乐高积木编程加盟
- 跟我学plc编程 plc编程自学入门视频教程
- ug编程成航林总 ug编程实战视频
- 孩子学编程的好处和坏处
- 初学者学编程该从哪里开始 新手学编程从哪里入
- 慢走丝编程 慢走丝编程难学吗
- 国内十强少儿编程机构 中国少儿编程机构十强有
- 成人计算机速成培训班 成人计算机速成培训班办
- 孩子学编程网上课程哪家好 儿童学编程比较好的
- 代码编程教学入门软件 代码编程教程