只要发新帖或者编辑帖子 文字加上颜色或者加个图片 就出现:- <SCRIPT>function _ZdicInit(){
- var agt = navigator.userAgent.toLowerCase();
- _Zdic_is_ie = (agt.indexOf("msie")!=-1 && document.all);
- var h = '<table width="240" cellspacing="0" cellpadding="0" ';
- h += 'style="border-top:1px solid #D4D0C8;border-left:1px solid #D4D0C8;';
- h += 'border-right:1px solid #808080;border-bottom:1px solid #808080;';
- h += '"><tr><td>';
- h += '<div width="100%" style="cursor:move;background-color:#CBDFF5;border:0px;" onmouseover="_Zdic_onmove=1;" onmouseout="_Zdic_onmove=0;">' ;
- h += '<table width="100%"><tr><td align="left" width="60%" style="background-color:#CBDFF5;">';
- h += '<div style="color:#565656;font-size:12px;background-color:#CBDFF5;">选字释义 - Zdic.net</div>';
- h += '</td>';
- h += '<td align="right" style="background-color:#CBDFF5;">';
- h += '<a href="'+_Zdic_help+'" target="_blank" title="帮助">';
- h += '<img src="'+_Zdic_host+'tools/images/help.gif" style="border:none;display:inline;" align="absmiddle">';
- h += '</a> ';
- h += '<a href="javascript:_ZdicClose()" title="关闭" target="_self">';
- h += '<img src="'+_Zdic_host+'tools/images/close.gif" style="border:none;display:inline;" align="absmiddle">';
- h += '</a>';
- h += '</td></tr></table>';
- h += '</div>';
-
- h += '<table border="0" cellspacing="4" cellpadding="3" width="100%" align="center" onmouseover="_Zdic_onlayer=1;" onmouseout="_Zdic_onlayer=0;">';
- h += '<tr><td>';
-
- h += '<table border="0" cellspacing="0" cellpadding="0" width="100%" align="center">';
- h += '<tr><td width="100%">';
- h += '<iframe id="_ZdicFrame" name="_ZdicFrame" HEIGHT="180" src="about:blank" FRAMEBORDER="0" width="100%"></iframe>';
- h += '</td></tr><tr align="center"><td width="100%" height="20">';
- h += '<a href="http://Zdic.net/" target="_blank" style="font-size:12px;color:#993300">漢典 Zdic.net</a>';
- h += '</td></tr></table></td></tr></table>';
- h += '</td></tr></table>';
- try{
- if (_Zdic_layer)
- {;}
- else
- {
- var el = document.createElement('div');
- el.id='_Zdic_layer';
- el.style.position='absolute';
- el.style.display='none';
- el.style.zIndex=9000;
- el.style.backgroundColor='#FFF';
- el.style.filter='Alpha(Opacity=96)';
-
- document.body.appendChild(el);
- _ZdicSet(el, h);
- }
-
- if (_Zdic_status)
- {;}
- else
- {
- el = document.createElement('div');
- el.id='_Zdic_status';
- el.style.position='absolute';
- el.style.backgroundColor='#F8F0E5';
- el.style.padding='2px';
- el.style.filter='Alpha(Opacity=96)';
- el.style.fontSize='14px';
- el.style.right = '3px';
- el.style.top = '-300px';
- el.style.zIndex=9000;
- el.style.border = '1px solid #808080';
- document.body.appendChild(el);
- _ZdicSet(el, _ZdicStatus());
- }
- }catch(x){
- alert("Zdic can not support this page.");
- alert(x);
- _Zdic_layer = true;
- return;
- }
- _ZdicClose();
-
- if (_Zdic_is_ie) {
- document.attachEvent("onmousemove", _ZdicMove);
- document.attachEvent("ondblclick", _ZdicQuery);
- document.attachEvent("onmouseup", _ZdicQuery);
- document.attachEvent("onselectstart", _ZdicSelect);
- document.attachEvent("onmousedown", _ZdicCheck);
- window.attachEvent("onload", _ZdicUpdateStatus);
- }else {
- document.addEventListener("mousemove", _ZdicMove, true);
- document.addEventListener("dblclick", _ZdicQuery, true);
- document.addEventListener("mouseup", _ZdicQuery, true);
- document.addEventListener("selectstart", _ZdicSelect, true);
- document.addEventListener("mousedown", _ZdicCheck, true);
- window.addEventListener("load", _ZdicUpdateStatus, true);
- }
- //var img = new Image();
- //img.src = _Zdic_host+"img/loading.gif";
- _Zdic_layer = document.getElementById('_Zdic_layer');
- _Zdic_status = document.getElementById('_Zdic_status');
- _Zdic_iframe = document.getElementById('_ZdicFrame');
- }
- function _ZdicSet(el, htmlCode) {
- var ua = navigator.userAgent.toLowerCase();
- if (ua.indexOf('msie') >= 0 && ua.indexOf('opera') < 0) {
- el.innerHTML = '<div style="display:none">for IE</div>' + htmlCode;
- el.removeChild(el.firstChild);
- }
- else {
- var el_next = el.nextSibling;
- var el_parent = el.parentNode;
- el_parent.removeChild(el);
- el.innerHTML = htmlCode;
- if (el_next) {
- el_parent.insertBefore(el, el_next)
- } else {
- el_parent.appendChild(el);
- }
- }
- }
- function _ZdicGetSel()
- {
- if (window.getSelection) return window.getSelection();
- else if (document.getSelection) return document.getSelection();
- else if (document.selection) return document.selection.createRange().text;
- else return '';
- }
- function _ZdicGetPos(event){
- if (_Zdic_is_ie) {
- _Zdic_x = window.event.clientX + document.documentElement.scrollLeft
- + document.body.scrollLeft;
- _Zdic_y = window.event.clientY + document.documentElement.scrollTop
- + document.body.scrollTop;
- }else {
- _Zdic_x = event.clientX + window.scrollX;
- _Zdic_y = event.clientY + window.scrollY;
- }
- }
- function _ZdicSelect(e){
- if (_Zdic_moving == 2)
- return false;
- else
- return true;
- }
- function _ZdicCheck(e) {
- _ZdicGetPos(e);
- var cx = 0;
- var cy = 0;
- var obj = _Zdic_layer;
- if (obj.offsetParent){
- while (obj.offsetParent){
- cx += obj.offsetLeft;
- cy += obj.offsetTop;
- obj = obj.offsetParent;
- }
- }else if (obj.x){
- cx += obj.x;
- cy += obj.y;
- }
- if(_Zdic_moving>0){
- if(_Zdic_onmove == 1){
- _Zdic_moving = 2;
- _Zdic_startx = _Zdic_x;
- _Zdic_starty = _Zdic_y;
- }else if(_Zdic_x < cx || _Zdic_x > (cx + 240) || _Zdic_y < cy || (!_Zdic_onlayer && _Zdic_y > (cy + 100) ) ){
- _ZdicClose();
- }else{
- _Zdic_moving = 1;
- }
- }
-
- }
- function _ZdicQuery(e) {
- if(_Zdic_moving == 1){
- if (_Zdic_is_ie) {
- window.event.cancelBubble = true;
- window.event.returnValue = false;
- }else{
- e.preventDefault();
- }
- return false;
- }
- if(_Zdic_moving == 2) {
- _Zdic_cx = _Zdic_x;
- _Zdic_cy = _Zdic_y;
- _Zdic_moving = 1;
- return false;
- }
- _ZdicGetPos(e);
- if (!_Zdic_enable) return true;
- var word = _ZdicGetSel();
- if(_Zdic_is_ie) word = word.replace(/^\s*|\s*$/g,"");
- word = "" + word;
- if (word == "") _Zdic_old_word = "";
- if(word == _Zdic_old_word || word.length > 1) return true;
- if (!/^[\u4e00-\u9fa5\uf900-\ufa2d]*$/.test(word)) return true;
- _ZdicShow(word);
- }
- function _ZdicDisplay(){
- var dx=262;
- var dy=264;
- _Zdic_y += 8;
- _Zdic_x += 16;
- if(_Zdic_is_ie){
- if (document.documentElement.offsetHeight && document.body.scrollTop+document.documentElement.scrollTop+document.documentElement.offsetHeight - _Zdic_y < dy){
- _Zdic_y = document.body.scrollTop+document.documentElement.scrollTop + document.documentElement.offsetHeight - dy;
- _Zdic_x += 14;
- }
- if (document.documentElement.offsetWidth && document.body.scrollLeft+document.documentElement.scrollLeft+document.documentElement.offsetWidth - _Zdic_x < dx){
- _Zdic_x = document.body.scrollLeft+document.documentElement.scrollLeft + document.documentElement.offsetWidth - dx;
- }
- }else{
- dx-=1;
- dy+=11;
- if (self.innerHeight && document.body.scrollTop+document.documentElement.scrollTop + self.innerHeight - _Zdic_y < dy) {
- _Zdic_y = document.body.scrollTop+document.documentElement.scrollTop + self.innerHeight - dy;
- _Zdic_x += 14;
- }
- if (self.innerWidth && document.body.scrollLeft+document.documentElement.scrollLeft + self.innerWidth - _Zdic_x < dx) {
- _Zdic_x = document.body.scrollLeft+document.documentElement.scrollLeft + self.innerWidth - dx;
- }
- }
- _Zdic_cx = _Zdic_x;
- _Zdic_cy = _Zdic_y;
- _Zdic_startx = _Zdic_x;
- _Zdic_starty = _Zdic_y;
- _Zdic_layer.style.left = _Zdic_cx+'px';
- _Zdic_layer.style.top = _Zdic_cy+'px';
- _Zdic_layer.style.display="";
- _Zdic_moving = 1;
- }
- function _ZdicShow(word){
- _ZdicDisplay();
- try{
- _Zdic_iframe.src='about:blank';
- var iframeWin = window.frames['_ZdicFrame'];
- iframeWin.document.open();
- iframeWin.document.write('<html><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta http-equiv="Content-Language" content="zh-CN" /><body><img src="/tools/images/z_tl.gif" /><br /><img src="/tools/images/z_tl2.gif" /></body></html>');
- iframeWin.document.close();
- }catch(x){
- }
-
- setTimeout(function(){_Zdic_iframe.src=_Zdic_host+'tools/zsc.asp?q='+encodeURI(word);},200);
- _Zdic_old_word = word;
- }
- function _ZdicMove(e){
- if(_Zdic_moving==2) {
- _ZdicGetPos(e);
- _Zdic_x = _Zdic_x-_Zdic_startx+_Zdic_cx;
- _Zdic_y = _Zdic_y-_Zdic_starty+_Zdic_cy;
- if (document.documentElement.scrollWidth - _Zdic_x < 262) {
- _Zdic_x = document.documentElement.scrollWidth - 262;
- }
- _Zdic_layer.style.left = _Zdic_x+'px';
- _Zdic_layer.style.top = _Zdic_y+'px';
- }
-
- }
- function _ZdicClose() {
- try
- {
- _Zdic_moving = 0;
- _Zdic_onmove = 0;
- _Zdic_onlayer = 0;
- _Zdic_layer.style.display="none";
- //setTimeout(function(){_Zdic_old_word = "";},500);
- }
- catch (x)
- {
- }
- }
- function _ZdicRemove() {
- try
- {
- _Zdic_moving = 0;
- _Zdic_onmove = 0;
- _Zdic_onlayer = 0;
- _Zdic_enable = false;
- _Zdic_layer.style.display="none";
- _Zdic_status.style.display="none";
- }
- catch (x)
- {
- }
- }
- function _ZdicEnable(){
- if (_Zdic_enable){
- _Zdic_enable = false;
- }else{
- _Zdic_enable = true;
- }
- _ZdicUpdateStatus();
- }
- function _ZdicUpdateStatus(){
- _ZdicSet(_Zdic_status, _ZdicStatus());
- }
- function _ZdicStatus(){
- var h='';
- return h;
- if (_Zdic_enable){
- h += '『<a href="'+_Zdic_help+'" title="查看选字释义帮助" target="_blank" style="color:#7A1A05;font-size:14px;background-color:#FCFCF5;">选字释义</a>已<a href="javascript:_ZdicEnable()" title="禁用选字释义" target="_self" style="color:#7A1A05;font-size:14px;background-color:#FCFCF5;">启用</a>』';
- }else{
- h += '『<a href="'+_Zdic_help+'" title="查看选字释义帮助" target="_blank" style="color:#7A1A05;font-size:14px;background-color:#FCFCF5;">选字释义</a>已<a href="javascript:_ZdicEnable()" title="启用选字释义" target="_self" style="color:#7A1A05;font-size:14px;background-color:#FCFCF5;">禁用</a>』';
- }
- h +=' <a href="javascript:_ZdicRemove();" target="_self"><img src='+_Zdic_host+'tools/images/close.gif border=0 align=absmiddle></a>';
- return h;
- }
- if(! document.getElementById('_Zdic_layer')){
- var _Zdic_is_ie = true;
- var _Zdic_host = 'http://Zdic.net/';
- var _Zdic_help = "http://Zdic.net/tools/#sc";
- var _Zdic_old_word = "";
- var _Zdic_moving = 0;
- var _Zdic_onmove = 0;
- var _Zdic_onlayer = 0;
- var _Zdic_startx = 0;
- var _Zdic_starty = 0;
- var _Zdic_cx = 0;
- var _Zdic_cy = 0;
- var _Zdic_x = 0;
- var _Zdic_y = 0;
- var _Zdic_enable = true;
- var _Zdic_layer;
- var _Zdic_status;
- var _Zdic_iframe;
- _ZdicInit();
- }else{
- try{
- _Zdic_enable = true;
- _Zdic_status.style.display="";
- _ZdicUpdateStatus();
- }catch(x){;}
- }
- Zdic_enable = false;
- </SCRIPT>
复制代码 怎么解决啊
[ 本帖最后由 hyxhov 于 2008-5-9 12:57 编辑 ] |