📄 js.js
字号:
<!--
// 跳窗脚本
var win = null;
function LyWindow(mypage,myname,w,h,scroll,resiza){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable='+resiza+'resizable'
win = window.open(mypage,myname,settings)
}
function newpage(htmlurl) {
var newwin=window.open(htmlurl,"newWin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,top=150,left=200,width=400,height=300");
newwin.focus();
return false;
}
// 判断空值函数
function CheckEmpty(obj,msg){ //判断是否空
if(obj.value==''){
alert(msg);
obj.focus();
return false;
}
return true;
}
// 判断是否是数字
function isSsnString (ssn,msg) //
{
var re=/^[0-9]*[0-9]$/i;
if(re.test(ssn.value))
return true;
else
alert(msg);
ssn.focus();
return false;
}
//确认执行
function go(src,q)
{
var ret;
ret = confirm(q);
if(ret!=false)window.location=src;
}
//
function showLen(obj)
{
document.getElementById("CountLen").value=fucCheckLength(obj.value);
}
// 判断字数汉字2个字符
function fucCheckLength(strTemp)
{
var i,sum;
sum=0;
for(i=0;i<strTemp.length;i++)
{
if ((strTemp.charCodeAt(i)>=0) && (strTemp.charCodeAt(i)<=255))
sum=sum+1;
else
sum=sum+2;
}
return sum;
}
// 字体大小
function ContentSize(size)
{
var obj=document.getElementById("size");obj.style.fontSize=size+"px";
}
// 复制文本
function copyText(obj)
{
var rng = document.body.createTextRange();rng.moveToElementText(obj);rng.scrollIntoView();rng.select();rng.execCommand("Copy");rng.collapse(false);
}
// 复制网址
function copyUrl(obj)
{
var rng = document.body.createTextRange();rng.moveToElementText(obj);rng.scrollIntoView();rng.select();rng.execCommand("Copy");rng.collapse(false);
alert("复制成功,请把此网址在你喜欢的论坛或QQ里面发给你的朋友!");
}
//默认下拉菜单
function DSelect(t1,s){//选中默认下拉列表
for(i=0; i<t1.length; i++) {
if(t1.options[i].value==s){t1.options[i].selected=true;return;}
}
}
// 图片缩放脚本
var flag=true;
function DrawImage(ImgD){
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width>=600){
ImgD.width=600;
ImgD.height=(image.height*600)/image.width;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
}
}
function cgimg(o){
var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';
return false;
}
// 滚动脚本
var rollspeed=30
var myInter;
function MarqueeV(){
var ooRollV=document.getElementById("oRollV");
var ooRollV1=document.getElementById("oRollV1");
var ooRollV2=document.getElementById("oRollV2");
if(ooRollV2.offsetTop-ooRollV.scrollTop<=0) {
ooRollV.scrollTop-=ooRollV1.offsetHeight;
}else{
ooRollV.scrollTop++;
}
}
function StartRollV() {
var ooRollV=document.getElementById("oRollV");
var ooRollV1=document.getElementById("oRollV1");
var ooRollV2=document.getElementById("oRollV2");
if (ooRollV) {
if (parseInt(ooRollV.style.height)>=ooRollV2.offsetTop) {
ooRollV.style.height = ooRollV2.offsetTop;
return;
}
ooRollV2.innerHTML=ooRollV1.innerHTML;
myInter=setInterval(MarqueeV,rollspeed);
ooRollV.onmouseover=function() {clearInterval(myInter)};
ooRollV.onmouseout=function() {myInter=setInterval(MarqueeV,rollspeed)};
}
}
function MarqueeH(){
var ooRollH=document.getElementById("oRollH");
var ooRollH1=document.getElementById("oRollH1");
var ooRollH2=document.getElementById("oRollH2");
if(ooRollH2.offsetLeft-ooRollH.scrollLeft<=0) {
ooRollH.scrollLeft-=ooRollH1.offsetWidth;
}else{
ooRollH.scrollLeft++;
}
}
function StartRollH() {
var ooRollH=document.getElementById("oRollH");
var ooRollH1=document.getElementById("oRollH1");
var ooRollH2=document.getElementById("oRollH2");
if (ooRollH) {
if (parseInt(ooRollH.style.width)>=ooRollH2.offsetLeft) {
oRollH.style.width = oRollH2.offsetLeft;
return;
}
ooRollH2.innerHTML=ooRollH1.innerHTML;
myInter=setInterval(MarqueeH,rollspeed);
ooRollH.onmouseover=function() {clearInterval(myInter)};
ooRollH.onmouseout=function() {myInter=setInterval(MarqueeH,rollspeed)};
}
}
// 图片脚本--------------------------
function lanyuimg(img,url,alt,blank)
{
if (blank==null)
blank=false;
with(document){
write("<table class='lanyuimg'>");
write("<tr><td>");
write("<a href='");
write(url);
if (blank)
write("' >"); // 添加onClick='return newpage(this.href);'为跳窗脚本
else
write("' target='_blank'>");
write("<img width='150' src='"); // 在width='150'后面添加height='高度'为图片固定大小
write(img);
write("' title='");
write(alt);
write("' ");
write("></a></td></tr></table>");
}
}
// FLASH动画脚本--------------------------
function lanyuflash(file, w, h)
{
document.write("<div style=\"padding:5px\"><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0\" width=\"");
document.write(w);
document.write("\" height=\"");
document.write(h);
document.write("\"><param name=\"movie\" value=\"");
document.write(file);
document.write("\"> <param name=\"quality\" value=\"high\"><embed src=\"");
document.write(file);
document.write("\" loop=\"false\" menu=\"false\" quality=\"high\" width=\"");
document.write(w);
document.write("\" height=\"");
document.write(h);
document.write("\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></embed></object></div>");
}
// 小表上--------------------------
function lanyutabletop(size,m)
{
with(document){
write("<DIV class=lframe><TABLE cellSpacing=0 cellPadding=0 width='100%'><TBODY><TR><TD class='tl'></TD><TD class='tm'><SPAN class='tt'>");
write(size);
write("</SPAN></TD><TD class='tr'></TD></TD></TR></TBODY></TABLE><TABLE cellSpacing=0 cellPadding=0 width='95%'><TBODY><TR><TD class='");
write(m);
write("'></TD><TD class='mm'>");
}
}
// 小表下--------------------------
function lanyutablebottom(m)
{
with(document){
write("</TD><TD class='");
write(m);
write("'></TD></TR></TBODY></TABLE><table width='95%' cellspacing='0' cellpadding='0'><tr><td bgcolor='#dddddd' height='1'></td></tr><tr><td height='5'></td></tr></table></div>");
}
}
// 大表--------------------------
function lanyutable(size)
{
with(document){
write("<TABLE cellSpacing=0 cellPadding=0 width='100%'><TBODY><TR><TD class=tl></TD><TD class=tm><TABLE cellSpacing=0 cellPadding=0 width='100%'><TBODY><TR><TD><SPAN class=tt>");
write(size);
write("</SPAN></TD></TR></TBODY></TABLE></TD><TD class=tr></TD></TR></TBODY></TABLE>");
}
}
//***********默认设置定义.*********Title标签显示************
tPopWait=0;//停留tWait豪秒后显示提示。
tPopShow=2000000;//显示tShow豪秒后关闭提示
showPopStep=20;
popOpacity=99;
//***************内部变量定义*****************
sPop=null;
curShow=null;
tFadeOut=null;
tFadeIn=null;
tFadeWaiting=null;
document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".cPopText {background: #f8f8f3; color:#696969;border: 1px #CCCCCC solid;padding:2px; height:20px;filter: Alpha(Opacity=0)}");
document.write("</style>");
document.write("<div id='dypopLayer' style='position:absolute;z-index:1000;' class='cPopText'></div>");
function showPopupText(){
var o=event.srcElement;
MouseX=event.x;
MouseY=event.y;
if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
if(o.dypop!=sPop) {
sPop=o.dypop;
clearTimeout(curShow);
clearTimeout(tFadeOut);
clearTimeout(tFadeIn);
clearTimeout(tFadeWaiting);
if(sPop==null || sPop=="") {
dypopLayer.innerHTML="";
dypopLayer.style.filter="Alpha()";
dypopLayer.filters.Alpha.opacity=0;
}
else {
if(o.dyclass!=null) popStyle=o.dyclass
else popStyle="cPopText";
curShow=setTimeout("showIt()",tPopWait);
}
}
}
function showIt(){
dypopLayer.className=popStyle;
dypopLayer.innerHTML=sPop;
popWidth=dypopLayer.clientWidth;
popHeight=dypopLayer.clientHeight;
if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
else popLeftAdjust=0;
if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
else popTopAdjust=0;
dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
dypopLayer.style.filter="Alpha(Opacity=0)";
fadeOut();
}
function fadeOut(){
if(dypopLayer.filters.Alpha.opacity<popOpacity) {
dypopLayer.filters.Alpha.opacity+=showPopStep;
tFadeOut=setTimeout("fadeOut()",1);
}
else {
dypopLayer.filters.Alpha.opacity=popOpacity;
tFadeWaiting=setTimeout("fadeIn()",tPopShow);
}
}
function fadeIn(){
if(dypopLayer.filters.Alpha.opacity>0) {
dypopLayer.filters.Alpha.opacity-=1;
tFadeIn=setTimeout("fadeIn()",1);
}
}
document.onmouseover=showPopupText;
// -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -