繁体中文
加入收藏
当前位置:首页 >> 网络 >> 网站制作 >> 网页保护色(背景变化)源码  
页面风格 [ ]  保护色 杏仁黄 秋叶褐 胭脂红 青草绿 海天蓝 葛巾紫 极光灰 银河白(默认色) 文字 [    ]  [上一篇  下一篇]  速达文章底端  速达页面底端
网页保护色(背景变化)源码
作者:     来源:    发表时间:2006-03-09     浏览次数:
[保护色(背景变化)选择框(字符显示)html代码]

[保护色(背景变化)选择框(图片显示)html代码](需要修改图片路径)

[保护色(背景变化)JS代码]  [保护色(背景变化)JS代码](有注释)


1.保护色(背景变化)选择框(字符显示)html代码 [复制]

<table border="0" id="pcoloration" cellspacing="0">
<tr>
<td style="padding-right: 6px">保护色</td>
<td style="filter: glow(color=#000000,strength=1)">
<A
onclick="ccolor.style.backgroundColor='FAF9DE';set_color('FAF9DE')"
href="javascript://" title="杏仁黄"><font style="font-size: 5pt" color="#FAF9DE">█</font></A> <A
onclick="ccolor.style.backgroundColor='FFF2E2';set_color('FFF2E2')"
href="javascript://" title="秋叶褐"><font style="font-size: 5pt" color="#FFF2E2">█</font></A> <A
onclick="ccolor.style.backgroundColor='FDE6E0';set_color('FDE6E0')"
href="javascript://" title="胭脂红"><font style="font-size: 5pt" color="#FDE6E0">█</font></A> <A
onclick="ccolor.style.backgroundColor='E3EDCD';set_color('E3EDCD')"
href="javascript://" title="青草绿"><font style="font-size: 5pt" color="#E3EDCD">█</font></A> <A
onclick="ccolor.style.backgroundColor='DCE2F1';set_color('DCE2F1')"
href="javascript://" title="海天蓝"><font style="font-size: 5pt" color="#DCE2F1">█</font></A> <A
onclick="ccolor.style.backgroundColor='E9EBFE';set_color('E9EBFE')"
href="javascript://" title="葛巾紫"><font style="font-size: 5pt" color="#E9EBFE">█</font></A> <A
onclick="ccolor.style.backgroundColor='EAEAEF';set_color('EAEAEF')"
href="javascript://" title="极光灰"><font style="font-size: 5pt" color="#EAEAEF">█</font></A> <A
onclick="ccolor.style.backgroundColor='FFFFFF';set_color('FFFFFF')"
href="javascript://" title="银河白"><font style="font-size: 5pt" color="#FFFFFF">█</font></A>
</td>
</tr>
</table>
 


2.保护色(背景变化)选择框(图片显示)html代码 [复制] (需要修改图片路径)

保护色 <A
onclick="ccolor.style.backgroundColor='FAF9DE';set_color('FAF9DE')"
href="###"><IMG height=10 alt=杏仁黄 src="...url/color1.gif"
width=10 border=0></A> <A
onclick="ccolor.style.backgroundColor='FFF2E2';set_color('FFF2E2')"
href="###"><IMG height=10 alt=秋叶褐 src="...url/color2.gif"
width=10 border=0></A> <A
onclick="ccolor.style.backgroundColor='FDE6E0';set_color('FDE6E0')"
href="###"><IMG height=10 alt=胭脂红 src="...url/color3.gif"
width=10 border=0></A> <A
onclick="ccolor.style.backgroundColor='E3EDCD';set_color('E3EDCD')"
href="###"><IMG height=10 alt=青草绿 src="...url/color4.gif"
width=10 border=0></A> <A
onclick="ccolor.style.backgroundColor='DCE2F1';set_color('DCE2F1')"
href="###"><IMG height=10 alt=海天蓝 src="...url/color5.gif"
width=10 border=0></A> <A
onclick="ccolor.style.backgroundColor='E9EBFE';set_color('E9EBFE')"
href="###"><IMG height=10 alt=葛巾紫 src="...url/color6.gif"
width=10 border=0></A> <A
onclick="ccolor.style.backgroundColor='EAEAEF';set_color('EAEAEF')"
href="###"><IMG height=10 alt=极光灰 src="...url/color7.gif"
width=10 border=0></A> <A
onclick="ccolor.style.backgroundColor='FFFFFF';set_color('FFFFFF')"
href="###"><IMG height=10 alt=银河白(默认色) src="...url/color8.gif"
width=10 border=0></A>
 


3.保护色(背景变化)JS代码 [复制]

//保护色
function get_cookie(name_to_get) {
var cookie_pair
var cookie_name
var cookie_value
var cookie_array = document.cookie.split("; ")
for (counter = 0; counter < cookie_array.length; counter++) {
cookie_pair = cookie_array[counter].split("=")
cookie_name = cookie_pair[0]
cookie_value = cookie_pair[1]
if (cookie_name == name_to_get) {
return unescape(cookie_value)
}
}
return null
}
var bg_color = get_cookie("bgColor_cookie")
function set_color(color_val) {
set_cookie("bgColor_cookie", color_val, 365, "/")
}
function set_cookie(cookie_name, cookie_value, cookie_expire, cookie_path, cookie_domain, cookie_secure) {
var cookie_string = cookie_name + "=" + cookie_value
if (cookie_expire) {
var expire_date = new Date()
var ms_from_now = cookie_expire * 24 * 60 * 60 * 1000
expire_date.setTime(expire_date.getTime() + ms_from_now)
var expire_string = expire_date.toGMTString()
cookie_string += "; expires=" + expire_string
}
if (cookie_path) {
cookie_string += "; path=" + cookie_path
}
if (cookie_domain) {
cookie_string += "; domain=" + cookie_domain
}
if (cookie_secure) {
cookie_string += "; true"
}
document.cookie = cookie_string
}
 


4.保护色(背景变化)JS代码(有注释) [复制]

//保护色
function get_cookie(name_to_get) {

var cookie_pair
var cookie_name
var cookie_value

// Split all the cookies into an array
var cookie_array = document.cookie.split("; ")

// Run through the cookies
for (counter = 0; counter < cookie_array.length; counter++) {

// Split the cookie into a name/value pair
cookie_pair = cookie_array[counter].split("=")
cookie_name = cookie_pair[0]
cookie_value = cookie_pair[1]

// Compare the name with the name we want
if (cookie_name == name_to_get) {

// If this is the one, return the value
return unescape(cookie_value)
}
}

// If the cookie doesn't exist, return null
return null
}

// Get the bgColor cookie
var bg_color = get_cookie("bgColor_cookie")

// Did the cookie exist?
//if (bg_color) {
// document.bgColor = bg_color
//}

function set_color(color_val) {

// Get the currently selected color
//var color_list = color_form.color_name
//var selected_color = color_list.options[color_list.selectedIndex].value

// Change the color of the background
//opener.document["bgColor"] = color_val

// Save it in a cookie
set_cookie("bgColor_cookie", color_val, 365, "/")
}

function set_cookie(cookie_name, cookie_value, cookie_expire, cookie_path, cookie_domain, cookie_secure) {

// Begin the cookie parameter string
var cookie_string = cookie_name + "=" + cookie_value

// Add the expiration date, if it was specified
if (cookie_expire) {
var expire_date = new Date()
var ms_from_now = cookie_expire * 24 * 60 * 60 * 1000
expire_date.setTime(expire_date.getTime() + ms_from_now)
var expire_string = expire_date.toGMTString()
cookie_string += "; expires=" + expire_string
}

// Add the path, if it was specified
if (cookie_path) {
cookie_string += "; path=" + cookie_path
}

// Add the domain, if it was specified
if (cookie_domain) {
cookie_string += "; domain=" + cookie_domain
}

// Add the secure Boolean, if it's true
if (cookie_secure) {
cookie_string += "; true"
}

// Set the cookie
document.cookie = cookie_string
}
 
责任编辑:firmiana   速达顶端
相关链接
  • 表格隐藏打开源码
  • 单击左键复制指定单元格内容源码
  • 网页保护色(背景变化)源码
  • 发表评论  打印本文  推荐本文  加入收藏  关闭窗口  返回顶部

    上一篇: unix时间戳和日期的转换

    下一篇: 单击左键复制指定单元格内容源码

        栏目导航
    - 学习 司法考试
    - 杂集 社会 散文 诗歌
    小说 戏剧 知识
    - 桥牌
    - 生活 衣食住行 其它
    - 其它
    - 电脑 应用 系统
    - 网络 应用 网页
        推荐专题
    - 2006司法考试大纲
    - 司法考试
    - 打牌速查
    - 桥牌文学
    最新文章
    下拉菜单
    什么是DOCTYPE
    表格隐藏打开源码
    phpcms模版与风格的文件列表说明
    单击左键复制指定单元格内容源码
    网页保护色(背景变化)源码
    unix时间戳和日期的转换
    牌例输入模板
    文字替换效果
    显示指定时间后关闭的层
    推荐文章
    热点文章
    网页保护色(背景变化)源码
    phpcms模版与风格的文件列表说明
    牌例输入模板
    文字替换效果
    unix时间戳和日期的转换
    网站首页head区代码规范
    什么是DOCTYPE
    表格链接和鼠标出入效果
    PHPCMS模板中的关键html代码
    javascript 实现一个空间安装多...
     
    网有评论    更多评论
     
    发表评论
    姓名: QQ:
    性别: MSN:
    E-mail: 主页:
    评分: 1 2 3 4 5
    评论内容:
    验证码:
      
  • 请遵守《互联网电子公告服务管理规定》及中华人民共和国其他各项有关法律法规。
  • 严禁发表危害国家安全、损害国家利益、破坏民族团结、破坏国家宗教政策、破坏社会稳定、侮辱、诽谤、教唆、淫秽等内容的评论。
  • 用户需对自己在使用本站服务过程中的行为承担法律责任(直接或间接导致的)。
  • 本站管理员有权保留或删除评论内容。
  • 评论内容只代表网友个人观点,与本网站立场无关。
  • 关于我们 联系方式 梧桐邻居 建立链接 返回顶部