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

📄 public.js

📁 最好用的站点内容管理系统 全部源代码都有
💻 JS
📖 第 1 页 / 共 4 页
字号:
			var a=new Image();
			a.src=img.src
			if(a.width > maxsize * 4)
			{
				img.style.width=maxsize;
			}
			else if(a.width >= maxsize)
			{
				img.style.width=Math.round(a.width * Math.floor(4 * maxsize / a.width) / 4);
			}
			return false;
		}
		function zoom_img(e, o)
		{
		var zoom = parseInt(o.style.zoom, 10) || 100;
		zoom += event.wheelDelta / 12;
		if (zoom > 0) o.style.zoom = zoom + '%';
		return false;
		}  




position = function(x,y)
{
    this.x = x;
    this.y = y;
}

getPosition = function(oElement)
{
    var objParent = oElement
    var oPosition = new position(0,0);
    while (objParent.tagName != "BODY")
    {
        oPosition.x += objParent.offsetLeft;
        oPosition.y += objParent.offsetTop;
        objParent = objParent.offsetParent;
    }
    return oPosition;
} 

function showDiv(obj,content)

{
    var pos = getPosition(obj)
    var objDiv = document.createElement("div");
    objDiv.className="lionrong";//For IE
    objDiv.style.position = "absolute";
	var tempheight=pos.y;
	var tempwidth1,tempheight1;
	var windowwidth=document.body.clientWidth;
	
	var isIE5 = (navigator.appVersion.indexOf("MSIE 5")>0) || (navigator.appVersion.indexOf("MSIE")>0 && parseInt(navigator.appVersion)> 4);
	var isIE55 = (navigator.appVersion.indexOf("MSIE 5.5")>0);
	var isIE6 = (navigator.appVersion.indexOf("MSIE 6")>0);
	var isIE7 = (navigator.appVersion.indexOf("MSIE 7")>0);

	if(isIE5||isIE55||isIE6||isIE7){var tempwidth=pos.x+305;}else{var tempwidth=pos.x+312;}
	objDiv.style.width = "300px";
    objDiv.innerHTML = content;
	if (tempwidth>windowwidth)
	{
		tempwidth1=tempwidth-windowwidth
		objDiv.style.left = (pos.x-tempwidth1) + "px";
	}
	else
	{
		if(isIE5||isIE55||isIE6||isIE7){objDiv.style.left = (pos.x + 10) + "px";}else{objDiv.style.left = (pos.x) + "px";}
	}
	if(isIE5||isIE55||isIE6||isIE7){objDiv.style.top = (pos.y+16) + "px";}else{objDiv.style.top = (pos.y+16) + "px";}

    objDiv.style.display = "";
    document.onclick=function () { if(objDiv.style.display==""){objDiv.style.display="none";} }
    document.body.appendChild(objDiv);
}

function ShowDivPic(obj,Urls,exname,length)
{
    var Url = Urls.replace("\\","/");
    var pos = getPosition(obj)
    var objDiv = document.createElement("div");
    objDiv.className="lionrong";//For IE
    objDiv.id="showpic_id";
    objDiv.style.position = "absolute";
	var tempheight=pos.y;
	var tempwidth1,tempheight1;
	var windowwidth=document.body.clientWidth;
	
	var isIE5 = (navigator.appVersion.indexOf("MSIE 5")>0) || (navigator.appVersion.indexOf("MSIE")>0 && parseInt(navigator.appVersion)> 4);
	var isIE55 = (navigator.appVersion.indexOf("MSIE 5.5")>0);
	var isIE6 = (navigator.appVersion.indexOf("MSIE 6")>0);
	var isIE7 = (navigator.appVersion.indexOf("MSIE 7")>0);
	switch(exname)
	{
	    case ".jpg":case ".gif":case ".bmp":case ".ico":case ".png":case ".jpeg":case ".tif":
	        if(length<12000)
	        {
                if(Url=="")
                {
                    var content = "无图片";
                }
                else
                {
                    var content = "<img src='"+Url+"' border='0' />";
                }
            }
            else
            {
                var content = "<img src='"+Url+"' border='0' width='100px'/>";
            }
            break;
	    case ".swf":
	        if(length<12000)
	        {
            var content = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\">";
            content+="<param name=\"movie\" value=\""+Url+"\" />"
            content+="<param name=\"quality\" value=\"high\" />"
            content+="<embed src=\""+Url+"\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\"></embed>"
            content+="</object>"
            }
            else
            {
            var content = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"100px\">";
            content+="<param name=\"movie\" value=\""+Url+"\" />"
            content+="<param name=\"quality\" value=\"high\" />"
            content+="<embed src=\""+Url+"\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"100px\"></embed>"
            content+="</object>"
            }
            break;
            break;
	    case ".html":case ".htm":case ".aspx":case ".shtm":case ".shtml":case ".asp":
            var content = "Path:"+Url;
            break;
        default:
            var content = "Path:"+Url;
            break;
	}
	if(isIE5||isIE55||isIE6||isIE7){var tempwidth=pos.x+250;}else{var tempwidth=pos.x+250;}
    objDiv.innerHTML = content;
	if (tempwidth>windowwidth)
	{
		tempwidth1=tempwidth-windowwidth
		objDiv.style.left = (pos.x-tempwidth1) + "px";
	}
	else
	{
		if(isIE5||isIE55||isIE6||isIE7){objDiv.style.left = (pos.x) + "px";}else{objDiv.style.left = (pos.x) + "px";}
	}
	if(isIE5||isIE55||isIE6||isIE7){objDiv.style.top = (pos.y+18) + "px";}else{objDiv.style.top = (pos.y+18) + "px";}

	objDiv.style.left = "250px";
    objDiv.style.top = (pos.y-68) + "px";
    objDiv.style.display = "";
    document.onclick=function () { if(objDiv.style.display==""){objDiv.style.display="none";} }
    document.body.appendChild(objDiv);
}

function hiddDivPic()
{
    var objDiv = document.getElementById("showpic_id");
    if (objDiv!=null&&objDiv!="undefined")
    {
       document.body.removeChild(objDiv);
    }
}
function closediv(objDiv)
{
   objDiv.parentNode.removeChild(objDiv);
}

function showfDiv(obj,content,width)

{
    var pos = getPosition(obj);
    var objDiv = document.getElementById("s_id");
    if (objDiv==null)
    {
        objDiv = document.createElement("div");
        objDiv.id="s_id";
    }
    objDiv.className="selectStyle";
    objDiv.style.position = "absolute";
	var tempheight=pos.y;
	var tempwidth1,tempheight1;
	var windowwidth=document.body.clientWidth;
	
	var isIE5 = (navigator.appVersion.indexOf("MSIE 5")>0) || (navigator.appVersion.indexOf("MSIE")>0 && parseInt(navigator.appVersion)> 4);
	var isIE55 = (navigator.appVersion.indexOf("MSIE 5.5")>0);
	var isIE6 = (navigator.appVersion.indexOf("MSIE 6")>0);
	var isIE7 = (navigator.appVersion.indexOf("MSIE 7")>0);

	if(isIE5||isIE55||isIE6||isIE7){var tempwidth=pos.x+305;}else{var tempwidth=pos.x+312;}
	objDiv.style.width = width+"px";
    objDiv.innerHTML = content;
	if (tempwidth>windowwidth)
	{
		tempwidth1=tempwidth-windowwidth
		objDiv.style.left = (pos.x-tempwidth1) + "px";
	}
	else
	{
		if(isIE5||isIE55||isIE6||isIE7){objDiv.style.left = (pos.x) + "px";}else{objDiv.style.left = (pos.x) + "px";}
	}
	if(isIE5||isIE55||isIE6||isIE7){objDiv.style.top = (pos.y+22) + "px";}else{objDiv.style.top = (pos.y+22) + "px";}

    objDiv.style.display = "";
    document.ondblclick=function () { if(objDiv.style.display==""){objDiv.style.display="none";} }
    document.body.appendChild(objDiv);
}

function selectFile(type,obj,height,width)
{
    var ShowObj = obj;
    if(isArray(obj) && obj.length > 1)
        ShowObj = obj[1];
    showfDiv(ShowObj,"loading...",width);
    LastSelectObj = obj;
    
	var  options={  
					   method:'get',  
					   parameters:"heights="+ height,  
					   onComplete:function(transport)
						{  
							var returnvalue=transport.responseText;
							if (returnvalue.indexOf("??")>-1)
								showfDiv(ShowObj,'Error',width);
							else
								var tempstr=returnvalue;
								showfDiv(ShowObj,tempstr,width);
						}  
				   }; 
	var arrtype=type.split("|")[0]
    switch(arrtype)
        {
            case "file":
	            new  Ajax.Request('../../configuration/system/iframe.aspx?FileType=file',options);
	            break;
	        case "pic":
	            new  Ajax.Request('../../configuration/system/iframe.aspx?FileType=pic',options);
	            break;
	        case "picEdit":
	            new  Ajax.Request('../../configuration/system/iframe.aspx?FileType=picEdit',options);
	            break;
	        case "date":
	            new  Ajax.Request('../../configuration/system/iframe.aspx?FileType=date',options);
	            break;
	        case "templet":
	            new  Ajax.Request('../../configuration/system/iframe.aspx?FileType=templet',options);
	            break;
	        case "path":
	            new  Ajax.Request('../../configuration/system/iframe.aspx?FileType='+type,options);
	            break;
	        case "newsclass":
	            new  Ajax.Request('../../configuration/system/iframe.aspx?FileType=newsclass',options);
	            break;
	        case "special":
	            new  Ajax.Request('../../configuration/system/iframe.aspx?FileType=special',options);
	            break;
	        case "newsspecial":
	            new  Ajax.Request('../../configuration/system/iframe.aspx?FileType=newsspecial',options);
	            break;
	        case "user_file":
	            new  Ajax.Request('../../configuration/system/iframe.aspx?FileType=user_file',options);
	            break;
	        case "user_pic":
	            new  Ajax.Request('../../configuration/system/iframe.aspx?FileType=user_pic',options);
	            break;
	        case "rulePram":
	            new  Ajax.Request('../../configuration/system/iframe.aspx?FileType=rulePram',options);
	            break;
	        case "rulesmallPramo":
	            new  Ajax.Request('../../configuration/system/iframe.aspx?FileType=rulesmallPramo',options);
	            break;
	        case "rulesmallPram":
	            new  Ajax.Request('../../configuration/system/iframe.aspx?FileType=rulesmallPram',options);
	            break;
	        case "discuss_file":
	            new  Ajax.Request('../../configuration/system/iframe.aspx?FileType=discuss_file',options);
	            break;
	        case "discuss_pic":
	            new  Ajax.Request('../../configuration/system/iframe.aspx?FileType=discuss_pic',options);
	            break;
	        case "newsLink":
	            new  Ajax.Request('../../configuration/system/iframe.aspx?FileType=newsLink',options);
	            break;
	        case "style":
	            new  Ajax.Request('../../configuration/system/iframe.aspx?FileType=style',options);
	            break;
	        case "Channel":
	            new  Ajax.Request('../../configuration/system/iframe.aspx?FileType=Channel',options);
	            break;
	        case "user_Hpic":

⌨️ 快捷键说明

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