ホームページ  >  記事  >  バックエンド開発  >  留言板下表情的添加

留言板下表情的添加

WBOY
WBOYオリジナル
2016-06-13 10:59:031462ブラウズ

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

谁有类似的代码,发出来给我看看呗!!感谢大家
------最佳解决方案--------------------
我幫你用jquery寫好了

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br /><html xmlns="http://www.w3.org/1999/xhtml"><br /><head><br /><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><br /><title> - </title><br /><script type='text/javascript' src="@bak/jquery-1.5.2.min.js"></script><br /><script type='text/javascript'><br />(function($){<br />	//擴展方法<br />		$.pop=function(_this,_type,_mess,_P,_tim,_script){<br />		$("#p_o").remove();<br />		if(_type){<br />			var Loc;<br />			if(typeof(_this)=='object'){<br />				_this=_this;<br />			}else{<br />				_this="#"+_this;<br />			}<br />			if(!_this){return;}<br /><br />			try{<br />				Loc=$(_this).offset();<br />				_T=Loc.top;<br />				oW=$(_this).css("width");<br />			}catch(e){}<br /><br />			popcss='<style type="text/css">';<br />			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;}';<br />			popcss+='#p_o div{background-color:#FEFEEA;padding:2px;}';<br />			popcss+='#p_o .i{background:url("/img/pop.gif") no-repeat scroll 0 0 transparent;}';<br />			popcss+='#p_o .r{word-wrap:break-word;padding:5px;margin:0;line-height:20px;color:#AF7132;}';<br />			popcss+='</style>';<br /><br />			$("body").prepend('<div id="p_o">'+popcss+'<div><p class="r">'+_mess+'</p></div><span class="i p"></span></div>');<br /><br />			_T=_T+parseInt($("#p_o").css("height"))/2;<br />			$("#p_o").css("top",_T);<br />			if(_tim){window.setTimeout('$("#p_o").remove();',_tim);}<br />			if(_script){eval("("+_script+")");}<br />		}else{<br />			$("#p_o").remove();<br />		}<br />	}<br />})(jQuery)<br /><br /><br /><br />$(function(){<br />	$('#c1').click(function(){<br />		_img=$('#img').html();<br />		$.pop($(this),'show',_img);<br />	})<br />   <br />	$('#c2').click(function(){<br />		$('#t1').attr('readonly');<br />	})<br />});<br /></script><br /></head><br /><br /><body><br /><input value="添加表情" id="c1"><br /><div id='img'><br /><img  src='1.jpg'    style="max-width:90%"  style="max-width:90%" alt="留言板下表情的添加" ><img  src='2.jpg'    style="max-width:90%"  style="max-width:90%" alt="留言板下表情的添加" ><br /></div><br /></body><br /></html>

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

------其他解决方案--------------------
在fckeditor  里有表情 自定义;可以借来用哦
------其他解决方案--------------------

引用:
var someValue=window.showModalDialog();
获取返回值 赋值给相应的文本框

这样就行
这个方法有很多,不要被qq表情给局限住了,随便弄个div排好版,根据js操作就可以的
------其他解决方案--------------------
谢谢大家,4楼的方法可以展示出图片,但是选不中图片,再帮我看看呗
------其他解决方案--------------------
这个我也想学习,能不能教一教
------其他解决方案--------------------
null
声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。