标签云
asm恢复 bbed bootstrap$ dul kcbzib_kcrsds_1 kccpb_sanity_check_2 kcratr_nab_less_than_odr MySQL恢复 obet ORA-00312 ORA-00704 ORA-00742 ORA-01110 ORA-01200 ORA-01555 ORA-01578 ORA-01595 ORA-600 2662 ORA-600 2663 ORA-600 3020 ORA-600 4000 ORA-600 4137 ORA-600 4193 ORA-600 4194 ORA-600 16703 ORA-600 kcbzib_kcrsds_1 ORA-600 KCLCHKBLK_4 ORA-600 kcratr_nab_less_than_odr ORA-15042 ORA-15196 ORACLE 12C oracle dul ORACLE PATCH Oracle Recovery Tools oracle加密恢复 oracle勒索 oracle勒索恢复 oracle异常恢复 ORACLE恢复 Oracle 恢复 ORACLE数据库恢复 oracle碎片 OSD-04016 YOUR FILES ARE ENCRYPTED 比特币加密文章分类
- MongoDB (1)
- MongoDB恢复 (1)
- Others (2)
- 中间件 (2)
- WebLogic (2)
- 操作系统 (112)
- 数据库 (1,885)
- DB2 (22)
- MySQL (82)
- Oracle (1,710)
- Data Guard (53)
- EXADATA (8)
- GoldenGate (24)
- ORA-xxxxx (168)
- ORACLE 12C (72)
- ORACLE 18C (6)
- ORACLE 19C (15)
- ORACLE 21C (3)
- Oracle 23ai (8)
- Oracle ASM (73)
- Oracle Bug (8)
- Oracle RAC (56)
- Oracle 安全 (6)
- Oracle 开发 (28)
- Oracle 监听 (29)
- Oracle备份恢复 (663)
- Oracle安装升级 (108)
- Oracle性能优化 (62)
- 专题索引 (5)
- 勒索恢复 (91)
- PostgreSQL (37)
- pdu工具 (7)
- PostgreSQL恢复 (13)
- SQL Server (34)
- SQL Server恢复 (14)
- TimesTen (7)
- 达梦数据库 (5)
- 达梦恢复 (3)
- 生活娱乐 (2)
- 至理名言 (11)
- 虚拟化 (2)
- VMware (2)
- 软件开发 (52)
- Asp.Net (9)
- JavaScript (12)
- PHP (2)
- 小工具 (35)
- MongoDB (1)
-
最近发表
- rmanext:从损坏的 Oracle RMAN 备份中强制提取数据文件
- 恢复案例分享:win丢失数据文件恢复
- 记录19c ASM磁盘掉线触发ORA-59048故障处理
- aix平台Oracle数据库由于断电无法启动故障处理
- 断电引起ORA-600 3005故障处理
- 记录一次云存储资源到期之后引起的数据库恢复
- Firebird 损坏数据库数据抢救工具—firebirdext
- Oracle 19c 202610补丁(RUs+OJVM)-19.33
- 由于con$.con#值达到极限,触发数据库增加约束报ORA-600 12807错误
- MongoDB 离线提取工具—mongoext
- .bres勒索病毒加密数据库dmp文件可恢复
- ORA-600 krsm_mrp_rebuild_lf_list.lno_mismatch
- 记录一次0丢失的ORA-00354: 损坏重做日志块标头故障恢复
- 不当数据库恢复操作导致一个月数据丢失
- obet快速修复oracle 位图损坏块
- 不太常见的10.2.0.1的oracle redo损坏恢复
- obet forcecopy功能抢救硬件故障中的数据文件
- kcratr_nab_less_than_odr和system坏块故障处理
- 通过obet 恢复system坏块,打开数据库
- obet dbv功能完整说明
分类目录归档:软件开发
动态更好网站背景图片、背景颜色,js调色板
今天考虑到管理员通过后台调整网站网址背景图片和背景颜色的问题,小小的下了下该功能模块,并实现了。
我的思路:管理员可以通过后台添加网站背景图片或者颜色,然后读入数据库中,管理员然后可以从数据库中选择一套模式进行发布出来,显示在前台。把管 理员选择的一套模式相关读入application里面,然后相关页面直接可以通过application里面取得数据库,显示相关页面,从而避免重复读 取数据库,影像网站效率。这其中涉及到两条语句(核心功能实现,我查msdn找到):
body_a.Style.Add(HtmlTextWriterStyle.BackgroundColor, “#123456″);//添加或者改变背景色
body_a.Style.Add(HtmlTextWriterStyle.BackgroundImage, “./img/2.jpg”);//添加或者改变背景图片
我这里添加body的id为body_a,并runat=“server”,这里没用从application里面取数据,直接写入字符串。
调色板:主要是在网上找的,自己稍微加工了下,代码大概公布如下:
js代码:
var ColorHex = new Array('00', '33', '66', '99', 'CC', 'FF')
var SpColorHex = new Array('FF0000', '00FF00', '0000FF', 'FFFF00', '00FFFF', 'FF00FF')
var current = null
function getEvent() {
if (document.all) {
return window.event; //如果是ie
}
func = getEvent.caller;
while (func != null) {
var arg0 = func.arguments[0];
if (arg0) {
if ((arg0.constructor == Event || arg0.constructor == MouseEvent) || (typeof (arg0) == "object" && arg0.preventDefault && arg0.stopPropagation)) {
return arg0;
}
}
func = func.caller;
}
return null;
}
function intocolor() {
document.getElementById("colorpanel").style.display = "";//show 调色板
var colorTable = ''
for (i = 0; i < 2; i++) {
for (j = 0; j < 6; j++) {
colorTable = colorTable + '<tr height=12>'
colorTable = colorTable + '<td width=11 style="background-color:#000000">'
if (i == 0) {
colorTable = colorTable + '<td width=11 style="background-color:#' + ColorHex[j] + ColorHex[j] + ColorHex[j] + '">'
}
else {
colorTable = colorTable + '<td width=11 style="background-color:#' + SpColorHex[j] + '">'
}
colorTable = colorTable + '<td width=11 style="background-color:#000000">'
for (k = 0; k < 3; k++) {
for (l = 0; l < 6; l++) {
colorTable = colorTable + '<td width=11 style="background-color:#' + ColorHex[k + i * 3] + ColorHex[l] + ColorHex[j] + '">'
}
}
}
}
colorTable = '<table width=253 border="0" cellspacing="0" cellpadding="0" style="border:1px #000000 solid;border-bottom:none;border-collapse: collapse" bordercolor="000000">'
+ '<tr height=30><td colspan=21 bgcolor=#cccccc>'
+ '<table cellpadding="0" cellspacing="1" border="0" style="border-collapse: collapse">'
+ '<tr><td width="3"><td><input type="text" name="DisColor" id="DisColor" size="6" disabled style="border:solid 1px #000000;background-color:#ffff00"></td>'
+ '<td width="3"><td><input type="text" name="HexColor" id="HexColor" size="7" style="border:inset 1px;font-family:Arial;" value="#000000"></td></tr></table></td></table>'
+ '<table border="1" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="000000" onmouseover="doOver()" onmouseout="doOut()" onclick="doclick()" style="cursor:hand;">'
+ colorTable + '</table>';
colorpanel.innerHTML = colorTable
}
function doOver() {
var evt = getEvent();
var element = evt.srcElement || evt.target;
var DisColor = document.getElementById("DisColor");
var HexColor = document.getElementById("HexColor");
if ((element.tagName == "TD") && (current != element)) {
if (current != null) { current.style.backgroundColor = current._background }
element._background = element.style.backgroundColor
DisColor.style.backgroundColor = rgbToHex(element.style.backgroundColor)
HexColor.value = rgbToHex(element.style.backgroundColor)
element.style.backgroundColor = "white"
current = element
}
}
/**
* firefox 的颜色是以(RGB())出现,进行转换
*/
function rgbToHex(aa) {
if (aa.indexOf("rgb") != -1) {
aa = aa.replace("rgb(", "")
aa = aa.replace(")", "")
aa = aa.split(",")
r = parseInt(aa[0]);
g = parseInt(aa[1]);
b = parseInt(aa[2]);
r = r.toString(16);
if (r.length == 1) { r = '0' + r; }
g = g.toString(16);
if (g.length == 1) { g = '0' + g; }
b = b.toString(16);
if (b.length == 1) { b = '0' + b; }
return ("#" + r + g + b).toUpperCase();
}
else {
return aa;
}
}
function doOut() {
if (current != null) current.style.backgroundColor = current._background;
}
function doclick() {
var evt = getEvent();
var element = evt.srcElement || evt.target;
if (element.tagName == "TD") {
bg = rgbToHex(element._background);
// alert("选取颜色: " + bg);
// return bg;
document.getElementById("TextBox1").value = bg;
document.getElementById("colorpanel").style.display = "none"; //选好颜色后,关闭colorpanel
}
}
aspx代码:
<table >
<tr>
<td><asp:TextBox ID=”TextBox1″ runat=”server”></asp:TextBox></td>
<td><input id=”Button1″ type=”button” value=”选取颜色” onclick=”intocolor();” /></td>
</tr>
<tr>
<td><div id=”colorpanel” style=”position: absolute;”></div></td>
<td> </td>
</tr>
</table>
注:外套table是为了,显示的时候稍微美观点
声明:现在公布的代码都是本地测试代码,因为项目还没有正式开始写,外观和功能尚可能还有些bug,这些等待到正式项目中调试;大家如果使用这些代码出现问题,请耐心调试,我保证我都是调试正常并且基本上达到我的需求的代码才会放在日志上的。
发表在 JavaScript
评论关闭

加我微信(17813235971)
加我QQ(107644445)

