📄 tab_user.js
字号:
//新闻模式分类显示菜单
function NewsSpanBar(){
this.f=1;
this.event = "click"; //**** if we wan'to change nav not with click event ,we must reset this event before it's loaded.
this.titleid = "";
this.bodyid="";
this.myaspx="";
this.class_dis = "dis";
this.class_undis = "undis";
this.class_hiton = "tab_search_on";
this.class_hitno = "tab_search";
//added for newstyle---Xu
this.keyword="http:n.dvbbs.net";
//end added by xu
var Tags,TagsCnt,len,flag;
var BClassName;
var UKeyword;
var UMyaspx;
this.load=function(){
if (!document.getElementById(this.titleid)||!document.getElementById(this.bodyid))
{
return false;
}
flag = this.f;
BClassName = [this.class_dis,this.class_undis,this.class_hiton,this.class_hitno];
UKeyword=this.keyword;
UMyaspx=this.myaspx;
Tags=document.getElementById(this.titleid).getElementsByTagName('p');
TagsCnt=document.getElementById(this.bodyid).getElementsByTagName('dl');
len=Tags.length;
for(var i=0;i<len;i++){
Tags[i].value = i;
//加入下面一行貌似可以解决FF下不支持event的现象。---added by xu
this.event = this.event ? this.event : (window.event ? window.event : null);
if (this.event!='click')
{
//edited by McJeremy&Xu
//change new3.event='',then changeNav,
//because if we do not set new3.event='',after it was loaded,it's event will be reset as 'click'
//Tags[i].onmouseover=function(){changeNav(this.value,UKeyword)};
if(i==flag)
changeNav(Tags[i].value,UKeyword,UMyaspx);
}
else
{
Tags[i].onclick=function(){changeNav(this.value,UKeyword,UMyaspx)};
}
TagsCnt[i].className=BClassName[1]; //display:none
}
Tags[flag].className=BClassName[3];
TagsCnt[flag].className=BClassName[0]; //display:block
}
function changeNav(v,keyword1,keyword2){
Tags[flag].className=BClassName[2];
TagsCnt[flag].className=BClassName[1]; //把上一步显示的标签隐掉
flag=v;
Tags[v].className=BClassName[3];
TagsCnt[v].className=BClassName[0];
/*以下部分由McJeremy&Xu添加,用于在用户中心的iframe添加连接。*/
var rnd=Math.ceil(Math.random()*10000)/10000 //加入随机数作查询参数,防止出现刷新过快出现提示的问题
switch(Tags[flag].innerHTML)
{
case '我的话题':
document.getElementById('topic_mine').src='topic_mine.aspx?keyword='+keyword1+'&isPostBack=1&rnd='+rnd+'&posttype=1&boardid=0&keywordin=author';
document.getElementById('topic_injoin').src='topic_injion.aspx?keyword='+keyword1+'&isPostBack=1&rnd='+rnd+'&posttype=0&boardid=0&keywordin=author';
break;
case '资料设置':
document.getElementById('user_alter').src='user_alter.aspx?rnd='+rnd;
break;
case '帮助':
document.getElementById('help').src='help.aspx?rnd='+rnd;
break;
case '短信箱':
document.getElementById('message_in').src='message_inbox.aspx?rnd='+rnd;
// document.getElementById('message_outbox').src='message_outbox.aspx?rnd='+rnd;
//document.getElementById('message_out').src='message_inbox.aspx?type=recyclebin&rnd='+rnd;
// document.getElementById('message_send').src='message_send.aspx?rnd='+rnd;
break;
case '我的好友':
document.getElementById('user_friend').src='user_friend.aspx?rnd='+rnd;
break;
case '我的文件':
document.getElementById('myfile').src='attach_list.aspx?uploader='+keyword1+'&rnd='+rnd;
break;
case '发表的主题':
document.getElementById('topic_mine').src='topic_mine.aspx?keyword='+keyword1+'&isPostBack=1&rnd='+rnd+'&posttype=1&boardid=0&keywordin=author';
break;
case '邀请注册':
document.getElementById('user_invite').src='user_invite.aspx';
break;
case '回复的帖子':
document.getElementById('topic_injoin').src='topic_injion.aspx?keyword='+keyword1+'&isPostBack=1&rnd='+rnd+'&posttype=0&boardid=0&keywordin=author';
break;
case '其它管理':
if(!isNaN(keyword2))
document.getElementById('my').src='my.aspx?a='+keyword2+'&rnd='+rnd;
else
document.getElementById('my').src='my.aspx?q=&rnd='+rnd;
break;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -