62,074
社区成员
发帖
与我相关
我的任务
分享
<!--在head之间引入jquery包-->
<script language="javascript" type="text/javascript" src="js/jquery-1.2.6.pack.js"></script>
<!--表情图片-->
<img class='face' src='1.gif'/>
<a class='face'><img width='20px' height='20px' src='1.gif'/></a>
<a class='face'><img width='20px' height='20px' src='2.gif'/></a>
<a class='face'><img width='20px' height='20px' src='3.gif'/></a>
<a class='face'><img width='20px' height='20px' src='4.gif'/></a>
<!--假定这个是编辑器-->
<input type='input' id='content' />
$(document).ready(function(){
$(a.face).click(function(){
var insert_img = $(this).html();
var old_html =$("#content").html();
$("#content").html(old_html + insert_img );
});
});
<SCRIPT language=JavaScript src="/lib/insert_face.js"></SCRIPT>
<IMG style="CURSOR: hand" onclick="setFace('1');"
src="http://image.123.com/bbs/smile/1.gif"> <IMG
style="CURSOR: hand" onclick="setFace('2');"
src="http://image.123.com/bbs/smile/2.gif">
function setFace($str)
{
document.getElementById("memo").value += "[SMILE="+$str+"]";
}
document.write('<img src="http://image.123.com/bbs/smile/1.gif" onclick="setFace(\'1\');" style="cursor:hand"> <img src="http://image.123.com/bbs/smile/2.gif" onclick="setFace(\'2\');" style="cursor:hand">
…………