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

📄 ehlpdhtm.js

📁 图从右急速向左滚动.rar
💻 JS
📖 第 1 页 / 共 5 页
字号:
	if (nClickY + nHeight + 20 < gBsClientHeight + document.body.scrollTop) {
		nTop = nClickY + 10;
	} else {
		nTop = (document.body.scrollTop + gBsClientHeight) - nHeight - 20;
	}
	if (nClickX + nWidth < gBsClientWidth + document.body.scrollLeft) {
		nLeft = nClickX;
	} else {
		nLeft = (document.body.scrollLeft + gBsClientWidth) - nWidth - 8;
	}
	
	if (nTop < document.body.scrollTop ) nTop  = document.body.scrollTop + 1;
	if (nLeft< document.body.scrollLeft) nLeft = document.body.scrollLeft + 1;


	window.getPopupDivStyle(nIndex).left = nLeft;
	window.getPopupDivStyle(nIndex).top = nTop;

	// Set the location of the background blocks
	window.getPopupShadowStyle(nIndex).left = 6;
	window.getPopupShadowStyle(nIndex).top = 6;
	if (gbBsIE55)
	{
		window.getPopupShadowStyle(nIndex).left = 4;
		window.getPopupShadowStyle(nIndex).top = 4;
	}

	if (gbBsMac) {
		// Total hack on the iMac to get the IFrame to position properly
		window.getPopupIFrameStyle(nIndex).pixelLeft = 100;
		window.getPopupIFrameStyle(nIndex).pixelLeft = 0;
		// Explicitly call BSSCOnLoad because the Mac doesn't seem to do it
		window.getPopupIFrame(nIndex).window.BSSCOnLoad();
	}

	BSSCPopup_Timeout(nIndex , nToken );
	
	return;
}

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

function BSSCGetContentSize(thisWindow, size)
{
	if (!((gBsBrowser.ie4) || (gBsBrowser.ns4)))
		return;

	if (gbBsMac) {
		size.x = 300;
		size.y = 300;
		return;
	}

	// Resize the width until it is wide enough to handle the content
	// The trick is to start wide and determine when the scrollHeight changes
	// because then we know a scrollbar is necessary. We can then go back
	// to the next widest size (for no scrollbar)

	var ClientRate = gBsClientHeight / gBsClientWidth;

	var GoldenSize = new BSSCSize(0,0);
	GoldenSize.x = gBsClientWidth * gBMaxXOfParent;
	GoldenSize.y = gBsClientHeight *gBMaxYOfParent ;

	if (ClientRate > gBRateH_W) {
		GoldenSize.y = GoldenSize.x * gBRateH_W;
	}
	else {
		GoldenSize.x = GoldenSize.y / gBRateH_W;
	}

	// Try to using parent specified max x.
	var x = 0;
	var maxgoldx = GoldenSize.x;
	var maxx = gBsClientWidth * gBMaxXOfParent;
	
	// This double resize causes the document to re-render (and we need it to)
	if (!gbBsIE5)
		thisWindow.moveTo(10000,10000); // this is used to fix the flash on IE4.
	thisWindow.resizeTo(1, 1);
	thisWindow.resizeTo(1, 1);
	thisWindow.resizeTo(maxgoldx, thisWindow.document.body.scrollHeight + gBscrollHeight);
	thisWindow.resizeTo(maxgoldx, thisWindow.document.body.scrollHeight + gBscrollHeight);
		
	var miny = thisWindow.document.body.scrollHeight + gBscrollHeight;
	
	if (miny > GoldenSize.y) // the popup does not fix in the parent wanted golden area. so try to expand itself as large as it can
	{
		thisWindow.resizeTo(maxx , thisWindow.document.body.scrollHeight + gBscrollHeight);
		thisWindow.resizeTo(maxx , thisWindow.document.body.scrollHeight + gBscrollHeight);
		
		miny = 	thisWindow.document.body.scrollHeight + gBscrollHeight;
		maxy = gBsClientHeight * gBMaxYOfParent;
		
		if (miny > maxy) { // the popup must have a scroll, OK let it be.
			miny = maxy;
			size.x = maxx;
			size.y = maxy;
			thisWindow.document.body.scroll = 'yes'; // At this time we do want to show scroll any more. so it will looks better a little.
		}
		else { // popup still can fit in the parent area by someway. now we choose the same h/w rate as parent.
			size.y = miny;
			
			//  downsize from maxx , now I try to using binary divide.
			x = maxx;
			deltax = -maxx/2;
			//j = 0;
			while (true) {
				x = x + deltax;
				thisWindow.resizeTo(x, miny);
				thisWindow.resizeTo(x, miny);
				diffy = thisWindow.document.body.scrollHeight + gBscrollHeight - x * ClientRate;
				if (diffy >  gBpermitYDelta ) // it is higher than wanted, so x need to be wide a little bitter
					deltax = Math.abs(deltax) /2;
				else if (diffy <  -gBpermitYDelta) // it is shorter than wanted, so x need to be narrow a little bitter
					deltax = -Math.abs(deltax) /2;
				else 
					// the y is close enough to wanted.
					break;
				if (Math.abs(deltax) < gBpermitXDelta) // the next change is too slight and it can be ignore.
					break;
			}
			size.x = thisWindow.document.body.scrollWidth; //+ gBscrollWidth;
			size.y = thisWindow.document.body.scrollHeight;// + gBscrollHeight;	
			thisWindow.document.body.scroll = 'no';
			
		// Handle absurd cases just in case IE flakes
	//		if (size.y < 100) {
	//			size.y = 100;
	//		}
		}
	}
	else {
		if (thisWindow.document.body.scrollWidth > maxgoldx) {
			size.x = maxx; 
			size.y = miny;	
			thisWindow.document.body.scroll = 'yes';
		}
		else {
			//  downsize from maxgoldx , now I try to using binary divide.
			x = maxgoldx;
			deltax = -maxgoldx/2;
			//i = 0;
			while (true) {
				x = x + deltax;
				thisWindow.resizeTo(x, miny);
				thisWindow.resizeTo(x, miny);
				diffy = thisWindow.document.body.scrollHeight + gBscrollHeight - x * gBRateH_W;
				if (diffy >  gBpermitYDelta ) // it is higher than wanted, so x need to be wide a little bitter
					deltax = Math.abs(deltax) /2;
				else if (diffy <  -gBpermitYDelta) // it is shorter than wanted, so x need to be narrow a little bitter
					deltax = -Math.abs(deltax) /2;
				else 
					// the y is close enough to wanted.
					break;
				if (Math.abs(deltax) < gBpermitXDelta) // the next change is too slight and it can be ignore.
					break;
				//i ++;
				
			}
			//size.x = x - gBscrollWidth;
			size.x = thisWindow.document.body.scrollWidth; //+ gBscrollWidth;
			size.y = thisWindow.document.body.scrollHeight ;
			thisWindow.document.body.scroll = 'no'; // At this time we do not want to show scroll any more. so it will looks better a little.
			thisWindow.resizeTo(size.x, size.y);
			if (thisWindow.document.body.scrollWidth > size.x)
			{
				size.x = thisWindow.document.body.scrollWidth;
			}
			if (thisWindow.document.body.scrollHeight > size.y)
			{
				size.y = thisWindow.document.body.scrollHeight;
			}
		}
	}
	
	// no reload no scrollbar.
	//size.x = size.x + 16;	 //reserve a width for scrollbar (IE 4.0 only)

	thisWindow.resizeTo(size.x, size.y);
	thisWindow.resizeTo(size.x, size.y);
	return;
}



function BSSCPopupParentClicked()
{
	if (!window.gbPopupTimeoutExpired) {
		return false;
	}
	
	document.onmousedown = gbOrignalOnMouseDown;

	// Simply hide the popup
	hideAll();

	window.gbPopupTimeoutExpired = false;

	return true;
}


function BSSCPopupClicked()
{
	if (!window.gbPopupTimeoutExpired) {
		return false;
	}


	var popupIFrame = getCurrentPopupIFrame();
	if (popupIFrame == null) {
		return true;
	}

/*
	if ("undefined" != typeof(popupIFrame.gbInPopupMenu) &&
		popupIFrame.gbInPopupMenu) {
		return true;
	}*/

	if (!((popupIFrame.window.event != null) &&
	    (popupIFrame.window.event.srcElement != null) &&
	    ((popupIFrame.window.event.srcElement.tagName == "A") ||
	    (popupIFrame.window.event.srcElement.tagName == "IMG")))) {
		document.onmousedown = gbOrignalOnMouseDown;

	// Simply hide the popup
		hideAll();

		window.gbPopupTimeoutExpired = false;

		return true;
	}
}


//trace the mouse over's position for hotspot
function  BSPSPopupOnMouseOver(event)
{
	if (gBsBrowser.ie4) {
		window.gnPopupClickX = event.clientX + document.body.scrollLeft;
		window.gnPopupClickY = event.clientY + document.body.scrollTop;
		window.gnPopupScreenClickX = event.screenX;
		window.gnPopupScreenClickY = event.screenY;
	} else if (gBsBrowser.ns4) {
		window.gnPopupClickX = event.pageX - window.pageXOffset;
		window.gnPopupClickY = event.pageY - window.pageYOffset;
		window.gnPopupScreenClickX = event.screenX - window.pageXOffset;
		window.gnPopupScreenClickY = event.screenY - window.pageYOffset;
	}
}


function BSSCHidePopupWindow()
{
	if (window.gPopupWindow != null) {
		if (gBsBrowser.ns4) {
			if ((typeof window.gPopupWindow != "undefined") && (!window.gPopupWindow.closed)) {
				window.gPopupWindow.close();
				window.gPopupWindow = null;
			}
		}
	}

	return;
}

// Add the PopupOnClick to the onclick array.
if (typeof(BsscRegisterOnClick) != "undefined")
{
	BsscRegisterOnClick(BsPopupOnClick);
}
//End to support previous popup functions

/// Section End  - Popup (JavaScript 1.0)

/// Section Begin - Embedded Stub (JavaScript 1.0)

var s_strAgent = navigator.userAgent.toLowerCase();
var s_nVer	   = parseInt(navigator.appVersion);

var s_bIE  = (s_strAgent.indexOf('msie') != -1);
var s_bNS  = (s_strAgent.indexOf('mozilla') != -1) && ((s_strAgent.indexOf('spoofer') == -1) && (s_strAgent.indexOf('compatible') == -1));
var s_bOpera	= (s_strAgent.indexOf('opera') != -1);

var s_bIE3Before = ((s_bIE) && (s_nVer <= 2));
var s_bNS3Before = ((s_bNS) && (s_nVer <= 3));

var s_bNS2		= ((s_bNS) && (s_nVer <= 2));
var s_bNS3		= ((s_bNS) && (s_nVer == 3));
var s_bIE300301	= ((s_bIE) && (s_nVer == 2) && ((s_strAgent.indexOf("3.00") != -1)||(s_strAgent.indexOf("3.0a") != -1)||(s_strAgent.indexOf("3.0b")!=-1)||(s_strAgent.indexOf("3.01")!=-1)));
var s_bIE302	= ((s_bIE) && (s_nVer == 2) && (s_strAgent.indexOf("3.02") != -1));


function HasExtJs()
{
	if (s_bIE3Before) { return false;}
	if (s_bNS3Before) {	return false;}
	if (typeof (BsGeneralOnLoad) == "undefined"){ return false; }
	return true;
}


function BSSCCreatePopupDiv()
{
	return;
}


function WritePopupMenuLayer()
{
	if (HasExtJs()) {_WritePopupMenuLayer();}
}

function BSSCPopup(strURL, width, height)
{
	var re = new RegExp("'", 'g');
	strURL = strURL.replace(re, "%27");

	if (HasExtJs())	{ 
		_BSSCPopup(strURL, width, height);
	}else{
		//Create a temporary window first to ensure the real popup comes up on top
		var wndTemp = null;
		if (!s_bNS3) {
			wndTemp = window.open("", "temp", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=3,width=4");
		}
		// Create the real popup window
		var wndPopup = window.open(strURL, "BSSCPopup", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=300,width=400");
		// Close the temporary
		if (!s_bNS3) {
			wndTemp.close();
		} else {
			wndPopup.focus();
		}
	}
}

var gbWndTemp = null, gbWndPopupLinks = null;
var gbstrParaTotal = "";

function PopupMenu_Invoke()
{
	if (HasExtJs()) {
		return _PopupMenu_Invoke(PopupMenu_Invoke.arguments);
	}
	if (s_bNS3Before || s_bIE3Before )	{
		var argLen 	= PopupMenu_Invoke.arguments.length;
		if (argLen < 5) {
			window.document.location.href = PopupMenu_Invoke.arguments[3];
			return false;
		}
		gbWndTemp = null;
		gbWndPopupLinks = null;
		gbstrParaTotal = "";
		for (var i = 0; i < (argLen - 2) / 2; i++) {
			var strParaLine = "";
			if (s_bNS2 || s_bOpera){
				strParaLine += "<a href=\"";
				strParaLine += PopupMenu_Invoke.arguments[2 * i + 3];
				strParaLine += "\">"
				strParaLine += PopupMenu_Invoke.arguments[2 * i + 2];
				strParaLine += "</a>";
			} else {
				strParaLine += "<a href=\"javascript:";
				strParaLine += "gotoUrl(\'";
				strParaLine += PopupMenu_Invoke.arguments[2 * i + 3];
				strParaLine += "\');\"";
				if (PopupMenu_Invoke.arguments[1] != '') {
					strParaLine += " TARGET='" + PopupMenu_Invoke.arguments[1] + "'";
				}
				strParaLine += ">";
				strParaLine += PopupMenu_Invoke.arguments[2 * i + 2];
				strParaLine += "</a>";
			}
			strParaLine += "<br>";
			gbstrParaTotal += strParaLine;
		}
		var nHeight = argLen * 15;
		var nWidth = 400;
		var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=auto";
		strParam += ",height=" + nHeight + ",width=200,resizable";
		
		//Create a temporary window first to ensure the real popup comes up on top
		//var wndTemp = null;
		if (!s_bNS3) {
			gbWndTemp = window.open("", "temp", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=3,width=4");
		} 
		gbWndPopupLinks = window.open("", "popuplinks", strParam);

		setTimeout("Wait_PopupMenuReady()", 100);
	}
	return true;
}

function Wait_PopupMenuReady() 
{
	if (gbWndPopupLinks != null && "object" == typeof(gbWndPopupLinks.document)) {
		PopupMenu_InvokeReady();
	}
	else 
		setTimeout("Wait_PopupMenuReady()", 100);
}


function PopupMenu_InvokeReady()
{
	if (gbWndPopupLinks != null) {
		gbWndPopupLinks.document.open("text/html");
		gbWndPopupLinks.document.write("<html><head>");
		if (s_bNS2 || s_bOpera) {
			gbWndPopupLinks.document.write("<base href=\"" + location +"\">");
		} else {
			//YJ: IE301,302 and NS3.x works fine
			gbWndPopupLinks.document.write("<");
			gbWndPopupLinks.document.write("script>");
			gbWndPopupLinks.document.write("function gotoUrl(aUrl) {opener.window.location=aUrl; close();}");
			gbWndPopupLinks.document.write("<");
			gbWndPopupLinks.document.write("/script>");
		}
		gbWndPopupLinks.document.write("</head><body onBlur=\'self.focus();\'>");
		gbWndPopupLinks.document.write(gbstrParaTotal);
		gbWndPopupLinks.document.write("</body></html>");
		gbWndPopupLinks.document.close();

		// Close the temporary
		if (!s_bNS3 && gbWndTemp != null) {
			gbWndTemp.close();
		}else {
			gbWndPopupLinks.focus();
		}

		return true;
	}
	return false;
}

/// Section End - Embedded Stub (JavaScript 1.0)

//// Segment End -- (JavaScript 1.0)

//// Segment Begin -- (JavaScript 1.2)
/// Section Begin  - kadov DHTM (JavaScript 1.2)

//Begin to support extended and dropdown text effects.
function kadovIsParagraph(el)
{
	return( el.tagName == "P" || el.tagName.indexOf("H") == 0 ) ? true : false;
}

⌨️ 快捷键说明

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