以下是 网易编辑器用法演示特效代码 的示例演示效果:
部分效果截图:
HTML代码(index.html):
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="keywords" content="JS代码,其他代码,JS广告代码,JS特效代码" />
<meta name="description" content="此代码内容为网易编辑器用法演示,属于站长常用代码" />
<title>网易编辑器用法演示</title>
<style type="text/css">
body{font-size:12px;color:#333333;}
</style>
</head>
<body>
<form name="form1" method="post" action="">
<input type="hidden" name="content" id="content" value="<div> 这是隐藏表单的内容</div>">
<iframe src="HtmlEditor/editor.html?id=content" frameborder="0" scrolling="no" width="700" height="320"></iframe>
<br><br>
<input type="button" value="查看隐藏表单的内容" onClick="alert(content.value);">
</form>
</body>
</html>
JS代码(colorSelect.js):
// Draw color selector// create 6-element arrayvar s = "";
var hex = new Array(6)// assign non-dithered descriptorshex[0] = "FF"hex[1] = "CC"hex[2] = "99"hex[3] = "66"hex[4] = "33"hex[5] = "00"// draw a single table cell based on all descriptorsfunction drawCell(red,green,blue){
// open cell with specified hexadecimal triplet background colorvar color = '#' + red + green + blue;
if(color == "#000066") color = "#000000";
s += '<TD BGCOLOR="' + color + '" style="height:12px;
width:12px;
" >';
// print transparent image (use any height and width)s += '<IMG '+ ((document.all)?"":"src='../images/place.gif'") +' HEIGHT=12 WIDTH=12>';
// close table cells += '</TD>';
}
// draw table row based on red and blue descriptorsfunction drawRow(red,blue){
// open table rows += '<TR>';
// loop through all non-dithered color descripters as green hexfor (var i = 0;
i < 6;
++i){
drawCell(red,hex[i],blue)}
// close current table rows += '</TR>';
}
// draw table for one of six color cube panelsfunction drawTable(blue){
// open table (one of six cube panels)s += '<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0>';
// loop through all non-dithered color descripters as red hexfor (var i = 0;
i < 6;
++i){
drawRow(hex[i],blue)}
// close current tables += '</TABLE>';
}
// draw all cube panels inside table cellsfunction drawCube(){
// open tables += '<TABLE CELLPADDING=0 CELLSPACING=0 style="border:1px #888888 solid"><TR>';
// loop through all non-dithered color descripters as blue hexfor (var i = 0;
i < 2;
++i){
// open table cell with white background colors += '<TD BGCOLOR="#FFFFFF">';
// call function to create cube panel with hex[i] blue hexdrawTable(hex[i])// close current table cells += '</TD>';
}
s += '</TR><TR>';
for (var i = 2;
i < 4;
++i){
// open table cell with white background colors += '<TD BGCOLOR="#FFFFFF">';
// call function to create cube panel with hex[i] blue hexdrawTable(hex[i])// close current table cells += '</TD>';
}
// close table row and tables += '</TR></TABLE>';
return s;
}
JS代码(samedomain.js):
function ResetDomain(){
var ss=document.domain;
//ss == "www.126.com";
var ii=ss.lastIndexOf('.');
if(ii>0){
if(!isNaN(ss.substr(ii+1)*1))return;
ii=ss.lastIndexOf('.',ii-1);
if(ii>0)document.domain=ss.substr(ii+1);
}
//document.domain == "126.com";
}
ResetDomain();