⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 head.js

📁 在Wind River公司开发的VxWorks嵌入式操作系统平台上
💻 JS
字号:
//短消息
function Shows(divid) {
	divid.filters.revealTrans.apply(); 
	divid.style.visibility = "visible";
	divid.filters.revealTrans.play(); 
}
function Hide(divid) {
	divid.filters.revealTrans.apply();
	divid.style.visibility = "hidden";
	divid.filters.revealTrans.play();
}

//下拉菜单
 var h;
 var w;
 var l;
 var t;
 var topMar = 1;
 var leftMar = -2;
 var space = 1;
 var isvisible;
 var MENU_SHADOW_COLOR='#cccccc';//定义下拉菜单阴影色
 var global = window.document
 global.fo_currentMenu = null
 global.fo_shadows = new Array

function HideMenu_mmc() 
{
 var mX;
 var mY;
 var vDiv;
 var mDiv;
	if (isvisible == true)
{
		vDiv = document.all("menuDiv");
		mX = window.event.clientX + document.body.scrollLeft;
		mY = window.event.clientY + document.body.scrollTop;
		if ((mX < parseInt(vDiv.style.left)) || (mX > parseInt(vDiv.style.left)+vDiv.offsetWidth) || (mY < parseInt(vDiv.style.top)-h) || (mY > parseInt(vDiv.style.top)+vDiv.offsetHeight)){
			vDiv.style.visibility = "hidden";
			isvisible = false;
		}
}
}

function ShowMenu_mmc(vMnuCode,tWidth) {
	vSrc = window.event.srcElement;
	vMnuCode = "<table id='submenu' cellspacing=1 cellpadding=3 style='width:"+tWidth+"'  onmouseout='HideMenu_mmc()'><tr height=23><td nowrap align=left class=table2>" + vMnuCode + "</td></tr></table>";

	h = vSrc.offsetHeight;
	w = vSrc.offsetWidth;
	l = vSrc.offsetLeft + leftMar+4;
	t = vSrc.offsetTop + topMar + h + space-2;
	vParent = vSrc.offsetParent;
	while (vParent.tagName.toUpperCase() != "BODY")
	{
		l += vParent.offsetLeft;
		t += vParent.offsetTop;
		vParent = vParent.offsetParent;
	}

	menuDiv.innerHTML = vMnuCode;
	menuDiv.style.top = t;
	menuDiv.style.left = l;
	menuDiv.style.visibility = "visible";
	isvisible = true;
    makeRectangularDropShadow(submenu, MENU_SHADOW_COLOR, 4)
}

function makeRectangularDropShadow(el, color, size)
{
	var i;
	for (i=size; i>0; i--)
	{
		var rect = document.createElement('div');
		var rs = rect.style
		rs.position = 'absolute';
		rs.left = (el.style.posLeft + i) + 'px';
		rs.top = (el.style.posTop + i) + 'px';
		rs.width = el.offsetWidth + 'px';
		rs.height = el.offsetHeight + 'px';
		rs.zIndex = el.style.zIndex - i;
		rs.backgroundColor = color;
		var opacity = 1 - i / (i + 1);
		rs.filter = 'alpha(opacity=' + (100 * opacity) + ')';
		el.insertAdjacentElement('afterEnd', rect);
		global.fo_shadows[global.fo_shadows.length] = rect;
	}
}
var stylelist = style+' &gt; <a style=font-size:9pt;line-height:12pt; href=\"?setstyle=no\"><font color=red>恢复默认风格</font></a>'

var functionbbs='<a style=font-size:9pt;line-height:12pt; href=\"search.php\">站内搜索</a><br><a style=font-size:9pt;line-height:12pt; href=\"myinfo.php\">个人资料</a><br><a style=font-size:9pt;line-height:12pt; href=\"./search.php?fid=&job=show_artic_top&desc=desc&bencandy_top=posttime&showusr=\"><font color=>文章排行</font></a><br><a style=font-size:9pt;line-height:12pt; href=\"./search.php?job=show_sort_top&bencandy_top=replies\"><font color=>栏目排行榜</font></a><br><a style=font-size:9pt;line-height:12pt; href=\"./search.php?job=myartic\"><font color=>我的主题</font></a><br><a style=font-size:9pt;line-height:12pt; href=\"./search.php?job=show_all_members\"><font color=>会员列表</font></a>'

document.write("<div id=menuDiv style='Z-INDEX: 2; VISIBILITY: hidden; WIDTH: 1px; POSITION: absolute; HEIGHT: 1px; BACKGROUND-COLOR: #9cc5f8'></div>");

//双击滚屏
var currentpos,timer; 
function initialize() 
{ 
timer=setInterval("scrollwindow()",10); 
} 
function sc() 
{ 
clearInterval(timer); 
} 
function scrollwindow() 
{ 
currentpos=document.body.scrollTop; 
window.scroll(0,++currentpos); 
if (currentpos != document.body.scrollTop) 
sc(); 
} 
document.onmousedown=sc 
//document.ondblclick=initialize //把前面的双斜杠线删除,双击就自动滚屏了


function html_trans(str) {
        str = str.replace(/\r/g,"");
        str = str.replace(/on(load|click|dbclick|mouseover|mousedown|mouseup)="[^"]+"/ig,"");
        str = str.replace(/<script[^>]*?>([\w\W]*?)<\/script>/ig,"");
        str = str.replace(/<a[^>]+href="([^"]+)"[^>]*>(.*?)<\/a>/ig,"\n[url=$1]$2[/url]\n");
        str = str.replace(/<font[^>]+color=([^ >]+)[^>]*>(.*?)<\/font>/ig,"\n[color=$1]$2[/color]\n");
        str = str.replace(/<img[^>]+src="([^"]+)"[^>]*>/ig,"\n[img]$1[/img]\n");
        str = str.replace(/<([\/]?)b>/ig,"[$1b]");
        str = str.replace(/<([\/]?)strong>/ig,"[$1b]");
        str = str.replace(/<([\/]?)u>/ig,"[$1u]");
        str = str.replace(/<([\/]?)i>/ig,"[$1i]");
        str = str.replace(/ /g," ");
        str = str.replace(/&/g,"&");
        str = str.replace(/"/g,"\"");
        str = str.replace(/</g,"<");
        str = str.replace(/>/g,">");
        str = str.replace(/<br>/ig,"\n");
        str = str.replace(/<[^>]*?>/g,"");
        str = str.replace(/\[url=([^\]]+)\]\n(\[img\]\1\[\/img\])\n\[\/url\]/g,"$2");
        str = str.replace(/\n+/g,"\n");
        return str;
}
function trans(){
	var str = "";
	ubb_iframe.focus();
	ubb_iframe.document.body.innerHTML = "";
	ubb_iframe.document.execCommand("paste");
	str = ubb_iframe.document.body.innerHTML;
	if(str.length == 0) {
		alert("剪切版不存在超文本数据!");
		return "";
	}
	document.FORM.atc_content.value+=html_trans(str);
}

//
function showson(ss){
	if (ss.style.display == 'none'){
		ss.style.display = '';
	}else{
		ss.style.display = 'none';
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -