日期:2014-05-17  浏览次数:20571 次

留言板上表情的添加
就是点击表情按钮,会弹出类似QQ表情的框,这是怎么做的呀?
是不是要用到插件呀??我有一个插件portraitSelect.htm,可是不知道要怎么用,

谁有类似的代码,发出来给我看看呗!!感谢大家
------最佳解决方案--------------------
我幫你用jquery寫好了
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title> - </title>
<script type='text/javascript' src="@bak/jquery-1.5.2.min.js"></script>
<script type='text/javascript'>
(function($){
//擴展方法
$.pop=function(_this,_type,_mess,_P,_tim,_script){
$("#p_o").remove();
if(_type){
var Loc;
if(typeof(_this)=='object'){
_this=_this;
}else{
_this="#"+_this;
}
if(!_this){return;}

try{
Loc=$(_this).offset();
_T=Loc.top;
oW=$(_this).css("width");
}catch(e){}

popcss='<style type="text/css">';
popcss+='#p_o{width:auto;left:'+Loc.left+'px;background-color:#ECECCA;border:1px solid #B39F82;padding:1px;position:absolute;display:block;z-index:9999;opacity:0.95;}';
popcss+='#p_o div{background-color:#FEFEEA;padding:2px;}';
popcss+='#p_o .i{background:url("/img/pop.gif") no-repeat scroll 0 0 transparent;}';
popcss+='#p_o .r{word-wrap:break-word;padding:5px;margin:0;line-height:20px;color:#AF7132;}';
popcss+='</style>';

$("body").prepend('<div id="p_o">'+popcss+'<div><p class="r">'+_mess+'</p></div><span class="i p"></span></div>');

_T=_T+parseInt($("#p_o").css("height"))/2;
$("#p_o").css("top",_T);
if(_tim){window.setTimeout('$("#p_o").remove();',_tim);}
if(_script){eval("("+_script+")");}
}else{
$("#p_o").remove();
}
}
})(jQuery)



$(function(){
$('#c1').click(function(){
_img=$('#img').html();
$.pop($(this),'show',_img);
})
   
$('#c2').click(function(){
$('#t1').attr('readonly');
})
});
</script>
</head>

<body>
<input value="添加表情" id="c1">
<div id='img'>
<img src='1.jpg' width='20' height='20'><img src='2.jpg' width='20' height='20'>
</div>
</body>
</html>

------其他解决方案--------------------
var someValue=window.showModalDialog();
获取返回值 赋值给相应的文本框

------其他解决方案--------------------
在fckeditor  里有表情 自定义;可以借来用哦
------其他解决方案--------------------
引用:
var someValue=window.showModalDialog();
获取返回值 赋值给相应的文本框

这样就行
这个方法有很多,不要被qq表情给局限住了,随便弄个div排好版,根据js操作就可以的
------其他解决方案--------------------
谢谢大家,4楼的方法可以展示出图片,但是选不中图片,再帮我看看呗
------其他解决方案--------------------
这个我也想学习,能不能教一教
------其他解决方案--------------------
null