我的html5的hash管理既然会刷新页面,请问怎么处理,搞的我好郁闷啊

body{font:normal12px/100%'MicrosoftYaHei','宋体',Arial,Helvetica,sans-serif;color:#000}
ul,ol,li{list-style:none}
h1,form,div,p,i,ul,li,ol,body,dd,dl,dt{margin:0;padding:0}
img{border:0}
a{text-decoration:none;}
a:hover{text-decoration:underline;color:red;}
form,fieldset{background:0;border:0;padding:0;margin:0;}
body{background:#011111;}
.indexHeader{width:100%;height:70px;margin:0auto;padding:10px0;}
.indexHeadernav{float:right;color:#60957a;line-height:70px;padding:04%;}
.indexHeadernava{color:#60957a;}
.main{background:#00271d;width:100%;overflow:hidden;top:90px;position:absolute;bottom:35px;}
.login{width:500px;margin:0auto;position:fixed;top:50%;left:50%;margin:-171px00-250px;z-index:1;}
.loginfieldset{line-height:45px;text-align:center;}
.loginlabel{font-size:16px;width:15%;display:inline-block;color:#fff;text-align:left;}
.logininput,.loginselect{padding:5px;font-size:14px;border:1pxsolid#212121;border-radius:5px;height:24px;outline:none;box-shadow:2px2px3px#8b9894inset;background:#d0e2dd;width:48%;line-height:36px;}
.loginselect{height:36px;width:50.5%;color:#999;}
.logininput:focus,.loginselect:focus{box-shadow:0px0px0px3px#1d8d70;border-radius:4px;}
.loginhgroup{color:#79a991;font-size:16px;background:url(../img/login_tit.png)no-repeatcenterbottom;line-height:40px;text-indent:90px;margin:10px0;}
.loginbutton{width:252px;height:42px;background:url(../img/login_b.png)no-repeat;text-align:center;font-size:16px;color:#fff;border:0;margin:8px17%00;float:right;cursor:pointer;}
input.login_code{width:29%;vertical-align:middle;}
.login_code_a{vertical-align:middle;display:inline-block;height:35px;}
.login_code_aimg{padding:0009px;}
.lobby{background:#00271d;width:100%;overflow:hidden;position:absolute;top:0px;bottom:35px;}
.luzi{width:80%;height:100%;margin:-22%-40%;position:fixed;top:50%;left:50%;z-index:1;}
.lobbynav{width:100%;height:45%;margin:0pxauto;}
.lobby.panel{width:100%;height:54%;margin:1%000;}
.lobbynava{width:10%;height:33.3%;border-left:3pxsolid#315149;border-top:3pxsolid#315149;border-bottom:3pxsolid#315149;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-webkit-transition:all0.3sease0s;display:inline-block;font-size:20px;font-weight:bold;color:#d6d7d7;text-decoration:none;line-height:200%;text-indent:1%;}
.lobbynava:nth-child(10n){border-right:3pxsolid#315149;border-top:3pxsolid#315149;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;}
.lobbynava:nth-last-child(1n+11){border-bottom:0px;}
.lobbynava:hover,.lobby.lobby_open{background:#193d34;color:#f7d203;}
.lobby_tit{width:100%;height:16%;margin:0pxauto;overflow:hidden;}
.lobby_titb{float:left;color:#fff;font-size:18px;font-weight:bold;line-height:20px;}
.lobby_titi{color:#ffd802;font-size:18px;font-weight:bold;line-height:20px;}
.lobby_tita{float:right;width:95px;height:32px;background:#000no-repeat;display:inline-block;color:#fff;font-size:18px;text-align:center;line-height:30px;bblr:expression(this.onFocus=this.blur());outline-style:none;text-decoration:none;}
.lobbyPage,.playPage{display:none;}
$(function(){
$(".pagel").click(function(){
hashobj(this);
});
$(".page2").click(function(){
hashobj(this);
});
functionhashobj(obj,ev){
varhash=obj.dataset.hash;
window.location.hash=hash;
}
window.onhashchange=function(){
window.location.reload();
};
varfirstHash=window.location.hash.substring(1)||'';
if($(".indexPage").get(0).dataset.hash==firstHash){
$(".lobbyPage").hide();
$(".playPage").hide();
$(".indexPage").show();
}
if($(".lobbyPage").get(0).dataset.hash==firstHash){
$(".playPage").hide();
$(".indexPage").hide();
$(".lobbyPage").show();
}
if($(".playPage").get(0).dataset.hash==firstHash){
$(".lobbyPage").hide();
$(".indexPage").hide();
$(".playPage").show();
}
});
會員登錄



12345678910
11121314151617181920
21222324252627282930
***12号台进入
扬帆大鱼
浏览 340回答 2
2回答

素胚勾勒不出你

window.onhashchange=function(){window.location.reload();};这页面要是不刷新,我才郁闷呢…
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript