📄 common.js
字号:
/*top nav*/
function menuFix() {
for(j=1;j<=8;j++){
var sfEls = document.getElementById("menu_content"+j).getElementsByTagName("li");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function(){
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
sfEls[i].onMouseDown=function(){
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
sfEls[i].onMouseUp=function(){
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
sfEls[i].onmouseout=function(){
this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
}
}
}
}
function show_content(menuid){
menu_rest();
var topmenu = document.getElementById("top_menu" + menuid);
var topmenucontent = document.getElementById("menu_content" + menuid);
topmenu.className="menu2";
topmenucontent.style.display="block";
}
function menu_rest(){
for(i=1;i<=8;i++){
document.getElementById("top_menu" + i).className="top_menu_normal";
document.getElementById("menu_content" + i).style.display="none";
}
}
var menuid=1;
function menu_select(){
menu_rest();
document.getElementById("top_menu" + selectid).className="menu2";
document.getElementById("menu_content" + selectid).style.display="block";
document.getElementById("top_menu" + selectid).className;
document.getElementById(selectid+'_'+menuid).className='ahover';
}
//mouse event
function hideleft(){
$("#box_left").hide();
$("#box_right").width("960");
$("#hideimg").hide();
$("#showimg").show();
}
function showleft(){
$("#box_left").show();
$("#box_left").width("200");
$("#box_right").width("760");
$("#hideimg").show();
$("#showimg").hide();
}
$(document).ready(function(){
$("#box_left").width("200");
$("#box_right").width("760");
});
$(document).ready(function(){
$("#righttab tr").mouseover(function(){
$(this).addClass("over");}).mouseout(function(){
$(this).removeClass("over");})
});
$(document).ready(function(){
$(".text").mouseover(function(){
$(this).addClass("colorfocus");}).mouseout(function(){
$(this).removeClass("colorfocus");})
});
$(document).ready(function(){
$(".addtxt").mouseover(function(){
$(this).addClass("colorfocus");}).mouseout(function(){
$(this).removeClass("colorfocus");})
});
$(document).ready(function(){
$("#righttab2 tr").mouseover(function(){
$(this).addClass("over");}).mouseout(function(){
$(this).removeClass("over");})
});
window.onload=menuFix;
/*checkbox*/
function allcheck(str){
var a = document.getElementsByName(str);
var n = a.length;
for(var i=0;i<n;i++){
a[i].checked =true;
}
}
function othercheck(str){
var a = document.getElementsByName(str);
var n = a.length;
for(var i=0;i<n;i++){
if(a[i].checked){
a[i].checked =false;
}
else{
a[i].checked =true;
}
}
}
function goto(url){
this.location.href=url;
}
function getSelect(sid,val)
{
var ele = G(sid);
for (i=0;i<ele.options.length;i++){
if(ele.options[i].value==val){
ele.options[i].selected=true;
selectedIndex = i;
break;
}
}
}
//检测checkbox是否被选中 obj checkbox 对象 type 类型 1 检测是否为空 2 只能选中一个
function chkSelect(objname,type,url)
{
var obj,count;
count = 0;
obj = document.getElementsByName(objname);
for(var i=0;i<obj.length;i++)
{
if(obj[i].checked)
{
count++;
}
}
if(type == 2)
{
if(count==0||count>1)
{
//obja.href = "javascript:void(0)";
alert("请选中一项进行操作!");
return false;
}
}
else
{
if(count == 0)
{
//obja.href = "javascript:void(0)";
alert("请至少选中一项进行操作!");
return false;
}
}
location.href = url;
return true;
}
function getSelect(obj,val)
{
var len = obj.options.length;
for(var i=0;i<len;i++)
{
if(obj.options[i].value==val)
{
obj.options[i].selected = true;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -