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

📄 global.js

📁 非常好的GIF格式分析.中文版的,我也是因为需要学习有关于GIF解码,找了很久才找到的
💻 JS
字号:
function imgzoom(o) 
{
	if(event.ctrlKey) 
	{
		var zoom = parseInt(o.style.zoom, 10) || 100;
		zoom -= event.wheelDelta / 12;
		if(zoom > 0) 
		{
			o.style.zoom = zoom + '%';
		}
		return false;
	} 
	else 
	{
		return true;
	}
}

function CheckTablesParent(e)
{		
		//2005-10-24 by 武眉博,huobazi  防止table把文章内容页面撑大
		//但是要保证其他部分的table不受影响。
		if(e.parentElement.id == ''||e.parentElement.id == null)
		{
			return false;
		}
		if(e.parentElement.id == 'content')
		{
			return true;
		}
		else
		{
			obj =  e.parentElement;
			CheckTablesParent(obj);			
		}		
}
function Init()
{
	//定义最大宽度
	var maxWidth = 550;
	var maxHeight = 350;	
	
	//2005-10-24 by 武眉博,huobazi  防止图片把文章内容页面撑大
	//如增加了广告代码需要做类似table那样的调整。
	var imgs = document.getElementById("content").getElementsByTagName("img");
	for(var i=0; i<imgs.length; i++)
	{
		var img = imgs[i];
		if (img.width > maxWidth)
		{
			img.width = maxWidth;
			if (img.parentElement.tagName != "A")
			{
				img.onclick = function(){window.open(this.src)}
				img.style.cursor = "pointer";
				img.style.cursor = "hand";
				//img.onmousewheel=function(){imgzoom(this);}
				//img.alt="点击看大图,或按住Ctrl键滚动鼠标滚轮放大或者缩小";
				img.alt=">>-请点击鼠标查看大图-<<";
			}
		}
	}	
	//2005-10-24 by 武眉博,huobazi  防止table把文章内容页面撑大
	var tables = document.getElementById("content").getElementsByTagName("table");
	for(var i=0; i<tables.length; i++)
	{
		var table = tables[i];
		if (table.offsetWidth > maxWidth && CheckTablesParent(table))
		{
			table.style.width = maxWidth;			
		}
	}
	
}

//运行代码
function runEx(cod1)  {
	 cod=document.getElementById(cod1)
	  var code=cod.value;
	  if (code!=""){
		  var newwin=window.open('','','');  
		  newwin.opener = null 
		  newwin.document.write(code);  
		  newwin.document.close();
	}
}
//复制代码
function doCopy(ID) { 
	if (document.all){
		 textRange = document.getElementById(ID).createTextRange(); 
		 textRange.execCommand("Copy"); 
	}
	else{
		 alert("此功能只能在IE上有效")
	}
}

self.moveTo(0,0);
self.resizeTo(screen.availWidth,screen.availHeight);
window.status="欢迎访问DotNet男孩社区,希望本站收集的资料对您有用!";
window.onload = Init;


/******************************************************************************
  Crossday Discuz! Board - Common Modules for Discuz!
  Modified by: Crossday Studio (http://crossday.com)
  Based upon:  http://www.cnzzz.com
*******************************************************************************/

var sPop = null;
var postSubmited = false;

function ctlent(obj) {

if (navigator.userAgent.indexOf('MSIE') > 0) {
	if (obj.keyCode == 9) {
		obj.returnValue = false;
		var sel = document.selection.createRange();
		sel.text = '\t';
		sel.select();
	}
}
	if(postSubmited == false && (obj.ctrlKey && obj.keyCode == 13) || (obj.altKey && obj.keyCode == 83)) {
		var Input = document.getElementsByName('input')[0];
		if(Input.pmsubmit) {
			postSubmited = true;
			Input.pmsubmit.disabled = true;
			Input.submit();
		} else if(validate(Input)) {
			postSubmited = true;
			if(Input.topicsubmit) Input.topicsubmit.disabled = true;
			if(Input.replysubmit) Input.replysubmit.disabled = true;
			if(Input.editsubmit) Input.editsubmit.disabled = true;
			Input.submit();
		}
	}

}

function checkall(form, prefix) {
	for(var i = 0; i < form.elements.length; i++) {
		var e = form.elements[i];
		if(e.name != 'chkall' && (!prefix || (prefix && e.name.match(prefix)))) {
			e.checked = form.chkall.checked;
		}
	}
}

function findobj(n, d) {
	var p,i,x; if(!d) d=document;
	if((p=n.indexOf("?"))>0 && parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document;
		n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all) x=d.all[n];
	for(i=0;!x && i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x && d.layers&&i>d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	return x;
}

function copyCode(obj) {
	var rng = document.body.createTextRange();
	rng.moveToElementText(obj);
	rng.scrollIntoView();
	rng.select();
	rng.execCommand("Copy");
	rng.collapse(false);
}

function runCode(obj) {
	var winname = window.open('', "_blank", '');
	winname.document.open('text/html', 'replace');
	winname.document.writeln(obj.value);
	winname.document.close();
}

function saveCode(obj) {
	var winname = window.open('', '_blank', 'top=10000');
	winname.document.open('text/html', 'replace');
	winname.document.writeln(obj.value);
	winname.document.execCommand('saveas','','code.htm');
	winname.close();
}

function dzconfirm(theURL, ConfirmMsg) {
	if (confirm( ConfirmMsg ))	{
		window.location.href=theURL;
	} else {
		return;
	} 
}

⌨️ 快捷键说明

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