<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>大气酷炫无刷新留言板--完美特效</title>
<meta name="keywords" content="网页特效,JS特效,Jquery特效,Flash特效,CSS特效">
<meta name="description" content="特效加工厂专门为站免费长打造完美兼容的网页特效">
<style type="text/css">
body
{
margin:0; padding:0; font-size:12px;font-family:"微软雅黑";
}
a:link {
color:#3f3f3f; text-decoration: none;
}
a:visited {
text-decoration:none; color: #3f3f3f;
}
a:hover {
text-decoration:none; color: #f46662;
}
a:active {
text-decoration: none; color:#f46662;
}
#top
{
width:750px; margin:0 auto; height:80px; margin-top:0px; padding-top:40px;
}
#log
{
width:100%; background-color:#fafafa; border-bottom:#d1d1d1 1px solid; height:30px; position:fixed; filter:alpha(opacity=70);-moz-opacity:0.7;-khtml-opacity: 0.7; opacity: 0.7;
}
#log_b
{
width:100%; border-bottom:#d1d1d1 1px solid; height:30px; position:relative; overflow:visible;
}
#lo
{
width:750px; margin:0 auto; line-height:30px;
}
#main
{
width:100%; background-color:#fafafa; border-top:#d1d1d1 1px solid; border-bottom:#32a1e3 4px solid; overflow:hidden; height:40px;
}
#menu
{
width:750px; margin:0 auto; line-height:40px;
}
#help
{
display:block; float:right; background-image:url("go.png"); background-repeat:no-repeat; background-position:right; padding-right:15px; background-position:50px 13px;
}
#bo
{
width:750px; margin:0 auto; overflow:hidden;
}
#action
{
width:750px; margin:0 auto;
}
.left
{
width:80px; height:100px; float:left;background-image:url("bg.png"); background-repeat:no-repeat; color:#FFFFFF; text-align:right; padding-right:20px; padding-top:5px;
}
.ly
{
margin-top:10px; float:left; display:none;
}
.right
{
width:640px; background-color:#999999; margin-left:10px; float:left; background-image:url("bg2.jpg"); background-repeat:no-repeat; background-position:bottom; background-color:#f1f1f1;
}
.bg
{
width:100%; height:7px;background-image:url("bg1.jpg"); background-repeat:no-repeat; background-position:bottom;
}
.zw
{
padding:10px; padding-top:0px; color:#484848; line-height:22px;
}
.big
{
font-size:30px;
}
.xx
{
color:#3aa3e1; background-image:url("tx.png"); background-repeat:no-repeat; padding-left:18px; background-position:0px 5px; width:300px;
}
.x2
{
width:300px; text-align:right;color:#7e7d7d;
}
#nr
{
width:736px; font-family:"微软雅黑";
}
input
{
font-family:"微软雅黑";color:#474747; font-size:12px;
}
#mm
{
width:170px;
}
#nc
{
width:150px;
}
#nr{
font-size:12px;
}
#btn
{
cursor:pointer;
}
.go{width:60px;position:fixed;_position:absolute;_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||200)-(parseInt(this.currentStyle.marginBottom,10)||0)));right:12px;bottom:25%;
}
.m
{
display:block;width:54px; height:40px; background-color:#b7bdbf; margin-top:2px; text-align:center; color:#FFFFFF; line-height:40px; cursor:pointer;
}
.m:hover
{
background-color:#2a93d2;
}
#gotobo
{
margin-top:2px;cursor:pointer; display:block;
}
#gototop
{
cursor:pointer;display:block;
}
#msg
{
color:Red;
}
#login
{
cursor:pointer;
}
.del
{
display:none;
}
#changePwd
{
width:250px; height:100px; margin-left:120px; position:fixed; margin-top:30px; border:#d1d1d1 1px solid;background-color:White; line-height:35px; padding-top:15px; display:none; padding-left:10px;
}
#cmsg
{
color:red;
}
#foot
{
width:750px; margin:0 auto; height:40px; line-height:40px; background-color:#fafafa; border:#d1d1d1 1px solid; text-align:center; color:#484848;
}
</style>
<script type="text/javascript" src="jquery-1.4.1.js"></script>
<script type="text/javascript">
$(function(){
init();
$("#nc").val("请填写昵称");
$("#nr").val("请填写留言内容,不少于5个字");
$("#nc").focusin(function(){
if($(this).val()=="请填写昵称")
{
$(this).val("");
}
}).focusout(function(){
if($(this).val()=="")
{
$(this).val("请填写昵称");
}
});
$("#nr").focusin(function(){
if($(this).val()=="请填写留言内容,不少于5个字")
{
$(this).val("");
}
}).focusout(function(){
if($(this).val()=="")
{
$(this).val("请填写留言内容,不少于5个字");
}
});
});
</script>
<script type="text/javascript">
var step=0;//判断登陆状态
$(function () {
$(".go").hide();
$(window).scroll(function(){
//当滚动条的位置处于距顶部100像素以下时,跳转链接出现,否则消失
if($(window).scrollTop()>100)
{
$(".go").fadeIn(1000);
}
else
{
$(".go").fadeOut(1000);
}
//当点击跳转链接后,回到页面顶部位置
});
$("#gototop").click(//定义返回顶部点击向上滚动的动画
function () {
$('html,body').animate({ scrollTop: 0 }, 700);
});
$("#gotobo").click(//定义返回顶部点击向上滚动的动画
function () {
$('html,body').animate({ scrollTop: document.body.clientHeight }, 700);
});
//发布留言
$("#btn").click(function(){
if($("#nr").val()!=""&&$("#nr").val()!="请填写留言内容,不少于5个字"&&$("#nc").val()!=""&&$("#nc").val()!="请填写昵称"&&$("#nr").val().length>=5)
{
var nc=$("#nc").val();
var nr=$("#nr").val();
$.post("site.asp",{"action":"add","nc":nc,"nr":nr},function(data,status){
if(status=="success")
{
if(data=="1")
{
$("#msg").html("添加留言成功!");
init();
}
else
{
$("#msg").html("添加留言失败!");
}
}
});
}
else
{
$("#msg").html("请正确填写留言昵称和留言内容!");
}
});
//登陆
$("#login").click(function(){
login();
});
})
//修改密码
function changePWD()
{
var oldPwd=$("#oldPwd").val();
var newPwd=$("#newPwd").val();
if(oldPwd!=""&&newPwd!="")
{
$.post("site.asp",{"action":"changePwd","oldPwd":oldPwd,"newPwd":newPwd},function(data,status){
if(status=="success")
{
$("#cmsg").html(data);
}
});
}else
{
$("#cmsg").html("新密码和旧密码不能为空");
}
}
//显示修改密码框
function showC()
{
$("#changePwd").fadeIn();
}
function closeC()
{
$("#changePwd").fadeOut();
}
//删除
function del(id)
{
if(confirm("确定删除这则留言?"))
{
$.post("site.asp",{"action":"del","id":id},function(data,status){
if(status=="success")
{
}
});
init();
}
}
//登陆
function login()
{
var uid=$("#uid").val();
var pwd=$("#pwd").val();
$.post("site.asp",{"action":"login","uid":uid,"pwd":pwd},function(data,status)
{
if(status=="success")
{
if(data=="1")//登陆成功
{
$("#lo").empty();
var func="new Dialog('这是一个默认对话框').show()";
$("#lo").html(uid+",欢迎你! <a href='#' onclick='showC()'>修改密码</a> <a href='#' onclick='logout()'>注销</a>");
step=1;
$(".del").css("display","inline");
}
}
});
}
//注销
function logout()
{
var dt="账号 <input type='text' id='uid'/> 密码 <input type='password' id='pwd'/> <input type='button' value='登 陆' id='login' onclick='login()'/>";
$("#lo").html(dt);
$.post("site.asp",{"action":"logout"},function(data,status){
if(status=="success")
{
step=0;
$(".del").css("display","none");
}
});
}
//初始化
function i