jQuery选择头像

js:

//头像选择

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" /> 

posted @ 2010-06-26 12:51  墨❤  阅读(1801)  评论(0编辑  收藏  举报