精华帖 (8) :: 良好帖 (2) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2011-09-16
测试一下哦,
|
|
返回顶楼 | |
发表时间:2011-09-16
测试一下哦
|
|
返回顶楼 | |
发表时间:2011-09-16
//function $(id){return document.getElementById(id);};//此处注掉后,快速回复和新闻评论可用。请注意
var c_s = ['black','darkred','red','orange','brown','yellow','green','olive','cyan','blue','darkblue','indigo','violet','gray','white']; var s_s = ['xx-small','x-small','small','medium','large','x-large','xx-large','60','61','62','63','64','65','66','67','68','69','70']; var a_s = ['left','center','right']; var j_t = $('post_body');if (j_t==null){j_t=$('editor_body');} //var f_m = $("quick_reply_form");if (f_m==null){f_m=$("comment_form");}if (f_m==null){f_m=$("editor_form");} //var f_m_a = f_m.action; //alert(f_m_a); //var c_btn = $("quick_reply_button");if (c_btn==null){f_m=$("submit_button");} //var cc_btn = function(){c_btn.click();}; var j_tv = j_t.value; function f_r_i(l, n) { var a = new Array(l); var b = new Array(n); for (var i = 0; i < l; i++) { a[i] = i } var t = a.length; for (var i = 0; i < n; i++) { var ai = parseInt(Math.random() * t); b[i] = a[ai]; a[ai] = a[t - 1]; t-- } return b }; function f_m_a(s,ri,sh_c,sh_s) { if (sh_s){ s = ""; } if (sh_c){ s = ""; } return s; }; function f_f_r(cl, il) { var a = []; while (il - cl >= 0) { a = a.concat(f_r_i(cl, cl)); il -= cl } if (il == 0) return a; return a.concat(f_r_i(cl, il)) }; function f_g_t(e){ var offset=e.offsetTop; if(e.offsetParent!=null) offset+=f_g_t(e.offsetParent); return offset; } function f_g_l(e){ var offset=e.offsetLeft; if(e.offsetParent!=null) offset+=f_g_l(e.offsetParent); return offset; } //打开DIV function f_o_d(){ //c_btn.style.display="none"; if ($("je_m")!=null){document.body.removeChild($("je_m"));} var div = document.createElement("div"); document.body.appendChild(div); div.id="je_m"; div.style.position="absolute"; div.style.top=f_g_t(j_t)+"px"; div.style.left=f_g_l(j_t)+"px"; div.style.width=100+"px"; div.style.backgroundColor="#36648B"; div.style.borderWidth="1px"; div.style.borderStyle="solid"; div.style.borderColor="#36648B"; var txt='评论小插件<div style="background-color:white;color:blue;"><input type="checkbox" id="sh_c" checked/><label for="sh_c" style="float:none">随机颜色</label><br/><input type="checkbox" id="sh_s"/><label for="sh_s" style="float:none">随机大小</label><br/><input type="checkbox" id="sh_a"/><label for="sh_a" style="float:none">随机方位</label><br/><input type="button" value="好了呀" id="commitBtn" onclick="f_c_m()"/></div>'; div.innerHTML=txt; div.style.zIndex=9999; //$("commitBtn").focus(); }; function f_c_m(){ var sh_c = $("sh_c").checked; var sh_s = $("sh_s").checked; var sh_a = $("sh_a").checked; if (sh_c || sh_s || sh_a){ var rs_txt = ""; var cl = c_s.length; var il = j_tv.length; var randIndexs = il <= cl ? f_r_i(cl, il) : f_f_r(cl, il); for (i = 0; i < j_tv.length; i++) { rs_txt += f_m_a(j_tv.charAt(i), randIndexs[i],sh_c,sh_s); }; j_t.value=sh_a?"":rs_txt; } document.body.removeChild($("je_m")); //c_btn.style.display="block"; //alert('完成'); }; f_o_d(); |
|
返回顶楼 | |
发表时间:2011-09-16
测试一下。。。
|
|
返回顶楼 | |
发表时间:2011-09-16
测试一下。。。
|
|
返回顶楼 | |
发表时间:2011-09-16
最后修改:2011-09-16
可视化操作 ![]() |
|
返回顶楼 | |
发表时间:2011-09-16
谷歌浏览器快速回复测试
|
|
返回顶楼 | |
发表时间:2011-09-16
哇靠 。。好强 。。试试试试
|
|
返回顶楼 | |
发表时间:2011-09-16
我也来测试一下啊
|
|
返回顶楼 | |
发表时间:2011-09-16
真的很不错耶
|
|
返回顶楼 | |