时间:2021-07-01 10:21:17 帮助过:4人阅读
//头像选择
function GetFace() {
var faceid = $("#SelFace").val();
if (faceid.length == 1) { faceid = "0" + faceid; }
$("#imgface").attr("src", "/WebUI/template/images/public/tutu"+faceid+".gif");
}
界面:
代码如下:
<select id="SelFace" name="SelFace" onchange="GetFace();">
<option value="1">头像1</option>
<option value="2">头像2</option>
<option value="3">头像3</option>
</select>
<img id="imgface" name="imgface" src="/WebUI/template/images/public/tutu01.gif" />