單頁面的鏈接顏色:
function changeGj(){
document.getElementById("jgqcImage").style.color="#0292cb";
document.getElementById("jgdmImage").style.color="#0292cb";
document.getElementById("gjImage").style.color="black";
document.getElementById("key1").innerHTML = "<input type=\"text\" id=\"tit1\" class=\"input_in\" name=\"tit1\"/>";
var gjInfo = "<div class=\"txt2_box_left\"><input type=\"radio\" name=\"guanjianzi\" value=\"jgmc\" checked=\"true\" id=\"jgmc\"/> 按機構名稱 <input type=\"radio\" name=\"guanjianzi\" value=\"jgdz\" id=\"jgdz\"/> 按機構註冊地址</div>";
document.getElementById("example").innerHTML =gjInfo;
document.getElementById("secondSearch").style.display = "";
}
function changeJgdm(){
document.getElementById("jgqcImage").style.color="#0292cb";
document.getElementById("jgdmImage").style.color="black";
document.getElementById("gjImage").style.color="#0292cb";
document.getElementById("key1").innerHTML = "<input type=\"text\" id=\"tit0\" class=\"input_in\" name=\"tit0\"/>";
document.getElementById("example").innerHTML = "<div class=\"txt2_box_left\">提示:請輸入由質檢局核發的九位代碼</div>";
document.getElementById("secondSearch").style.display = "none";
}
function changeJgqc(){
document.getElementById("jgqcImage").style.color="black";
document.getElementById("jgdmImage").style.color="#0292cb";
document.getElementById("gjImage").style.color="#0292cb";
document.getElementById("key1").innerHTML = "<input type=\"text\" id=\"tit2\" class=\"input_in\" name=\"tit2\"/>";
document.getElementById("example").innerHTML = "<div class=\"txt2_box_left\">提示:請輸入完整、規範的註冊名稱</div>";
document.getElementById("secondSearch").style.display = "none";
}
禁用右鍵等:
<script type="text/javascript">
document.οncοntextmenu=function(){
return false;
};
document.οndragstart=function(){
return false;
};
document.onselectstart=function(){
return false;
};
document.onbeforecopy=function(){
return false;
};
document.οnselect=function(){
document.selection.empty();
};
document.οncοpy=function(){
document.selection.empty();
};
document.οnmοuseup=function(){
document.selection.empty();
};
</script>
拼JS串的方法:(str)
var str1;
var str2;
for(var i = 1 ; i<=3 ; i ++){
str1 = "jg" + i;
if(i == str){
str2 = "titleindex";
}else{
str2 = " ";
}
document.getElementById(str1).className=str2;
}
.titleindex{
color:black!important;
text-decoration:none!important; //強制 防止衝突
}
獲得屏幕中間:
function popwin(url,windowname,left,top,w,h)
{
var left = parseInt((screen.availWidth/2) - (w/2));//屏幕的位置
var top = parseInt((screen.availHeight/2) - (h/2));
var windowconfig ="left="+ left +",top="+ top +",status=no,scrollbars=yes,resizable=no,toolbar=no,location=no,width=" + w + ",height=" + h;
//alert(windowconfig);
var subwin=window.open(url, windowname, windowconfig);
subwin.focus();
}