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

📄 jsballoon.js

📁 原有短信通道业务处理流程是流水线模式,也就是一个线程处理完所有业务,后面的数据需要等待前面的数据处理完后方再次处理
💻 JS
📖 第 1 页 / 共 3 页
字号:
/*----------------------------------------------------------------------------\
|                               JSBalloon                                     |
|-----------------------------------------------------------------------------|
|                   Created by Arkady (Alex) Lesniara                         |
|                           (arkady@lesniara.com)                             |
|-----------------------------------------------------------------------------|
|                  Copyright (c) 2005 Arkady Lesniara                         |
|-----------------------------------------------------------------------------|
| This software is provided "as is", without warranty of any kind, express or |
| implied, including  but not limited  to the warranties of  merchantability, |
| fitness for a particular purpose and noninfringement. In no event shall the |
| authors or  copyright  holders be  liable for any claim,  damages or  other |
| liability, whether  in an  action of  contract, tort  or otherwise, arising |
| from,  out of  or in  connection with  the software or  the  use  or  other |
| dealings in the software.                                                   |
\----------------------------------------------------------------------------*/

var JSBalloonPath="";

/*	Class: JSBalloon
	Provides a flexible, encapsulated way to implement a passive feedback mechanism
	in a DHTML environment. Define and initialize this object globally, otherwise it will create a new instance 
	each time you call it's constructor. Set up the object with an object array passed to the constructor or, once instantiated,
	with properties. See <Usage> for more.
*/
function JSBalloon()
{
	var tmrBalloonPopup;
	
	var blbWidth=200;;
	var titleFontStyle='font-family: MS Sans Serif;font-weight: bold; font-size:10pt;';
	var messageFontStyle='font-family: MS Sans Serif\; font-size:10pt\;';
	var footerFontStyle='font-family: MS Sans Serif\; font-size:10pt\;';
	var transShow=true;
	var transHide=true;
	var transShowFilter='progid:DXImageTransform.Microsoft.Fade(Overlap=1.00)';
	var transHideFilter='progid:DXImageTransform.Microsoft.Fade(Overlap=1.00)';
	var autoHide=true;
	var autoHideInterval=4000; // 4 sec
	var autoAway=true;
	var showCloseBox=false;
	
	if(JSBalloon.arguments.length>0)
	{
		var oArg=JSBalloon.arguments[0];
		
		if(oArg.width!=null)
		{
			blbWidth=oArg.width;
		}
		
		if(oArg.titleFontStyle!=null)
		{
			titleFontStyle=oArg.titleFontStyle;
		}
		
		if(oArg.messageFontStyle!=null)
		{
			messageFontStyle=oArg.messageFontStyle;
		}
		
		if(oArg.footerFontStyle!=null)
		{
			footerFontStyle=oArg.footerFontStyle;
		}
		
		if(oArg.transShow!=null)
		{
			transShow=oArg.transShow;
		}
		
		if(oArg.transHide!=null)
		{
			transHide=oArg.transHide;
		}
		
		if(oArg.transShowFilter!=null)
		{
			transShowFilter=oArg.transShowFilter;
		}
		
		if(oArg.transHideFilter!=null)
		{
			transHideFilter=oArg.transHideFilter;
		}
		
		if(oArg.autoHide!=null)
		{
			autoHide=oArg.autoHide;
		}
		
		if(oArg.autoHideInterval!=null)
		{
			autoHideInterval=oArg.autoHideInterval;
		}
		
		if(oArg.autoAway!=null)
		{
			autoAway=oArg.autoAway;
		}
		
		if(oArg.showCloseBox!=null)
		{
			showCloseBox=oArg.showCloseBox;
		}
	}
	
	// Public properties
	
	/*	Property: titleFontStyle
			Sets or retrieves a Cascading Style Sheet formatted value that formats the balloon's title (heading).
		
		Syntax:
			object.titleFontStyle [= sCSS ]
			
		Possible Values:
			sCSS - *variant* that specifies a properly formed Cascading Style Sheet formatting.
			
		Examples:
			balloonObj.titleFontStyle="font-family: MS Sans Serif;font-weight: bold; font-size:12pt;";
	*/
	this.titleFontStyle=titleFontStyle;
	
	/*	Property: messageFontStyle
			Sets or retrieves a Cascading Style Sheet formatted value that formats the balloon's main message body.

		Syntax:
			object.messageFontStyle [= sCSS ]
			
		Possible Values:
			sCSS - *variant* that specifies a properly formed Cascading Style Sheet formatting.
			
		Examples:
			balloonObj.messageFontStyle="font-family: MS Sans Serif;font-weight: bold; font-size:12pt;";
	*/	
	this.messageFontStyle=messageFontStyle;
	
	/*	Property: footerFontStyle
			Sets or retrieves a Cascading Style Sheet formatted value that formats the balloon's footer.

		Syntax:
			object.footerFontStyle [= sCSS ]
			
		Possible Values:
			sCSS - *variant* that specifies a properly formed Cascading Style Sheet formatting.
			
		Examples:
			balloonObj.footerFontStyle="font-family: MS Sans Serif;font-weight: bold; font-size:12pt;";
	*/	
	this.footerFontStyle=footerFontStyle;
	
	/*	Property: transShowFilter
			Sets or retrieves a value of a transition (a filter) applied when showing the balloon.
			
		Syntax:
			object.transShowFilter [= string ]
			
		Possible Values:
			string - *variant* that specifies the transition filter. More information found at http://msdn.microsoft.com/workshop/author/filter/reference/reference.asp
		
		Examples:
			balloonObj.transShowFilter="progid:DXImageTransform.Microsoft.Stretch(stretchstyle=SPIN)";
			
		See also:
			<transShow>
	*/	
	this.transShowFilter=transShowFilter;
	
	/*	Property: transHideFilter
			Sets or retrieves a value of a transition (a filter) applied when hiding the balloon.
			
		Syntax:
			object.transHideFilter [= string ]
			
		Possible Values:
			string - *variant* that specifies the transition filter. More information found at http://msdn.microsoft.com/workshop/author/filter/reference/reference.asp
		
		Examples:
			balloonObj.transHideFilter="progid:DXImageTransform.Microsoft.Slide(slidestyle=HIDE,Bands=1)";
			
		See also:
			<transHide>
	*/	
	this.transHideFilter=transHideFilter;
	
	/*	Property: transShow
			Sets or retrieves a value indicating whether to apply transition filter specified in 
			<transShowFilter> when showing the balloon.
			
		Syntax:
			object.transShow [= bValue ]
			
		Possible Values:
			bValue - *boolean* true / false
		
		Examples:
			balloonObj.transShow=true;
			
		See also:
			<transShowFilter>
	*/	
	this.transShow=transShow;
	
	/*	Property: transHide
			Sets or retrieves a value indicating whether to apply transition filter specified in 
			<transHideFilter> when hiding the balloon.
			
		Syntax:
			object.transHide [= bValue ]
			
		Possible Values:
			bValue - *boolean* true / false
		
		Examples:
			balloonObj.transHide=true;
			
		See also:
			<transHideFilter>
	*/
	this.transHide=transHide;
	
	/*	Property: autoHide
			Sets or retrieves a value indicating whether to automatically hide the balloon 
			after s time specified in <autoHideInterval>.
			
		Syntax:
			object.autoHide [= bValue ]
			
		Possible Values:
			bValue - *boolean* true / false
		
		Examples:
			balloonObj.autoHide=true;
			
		See also:
			<autoHideInterval>
	*/	
	this.autoHide=autoHide;
	
	/*	Property: autoHideInterval
			Sets or retrieves a value indicating how long to wait before executing <autoHide>.
			
		Syntax:
			object.autoHideInterval [= iValue ]
			
		Possible Values:
			iValue - *integer* number of milliseconds to wait before activating <autoHide>.
		
		Examples:
			balloonObj.autoHideInterval=5000; // 5 Sec
			
		See also:
			<autoHide>
	*/	
	this.autoHideInterval=autoHideInterval;
	
	/*	Property: autoAway
			Sets or retrieves a value of this property. 
			When set to true the balloon will immediately run the <Hide> method on mouse over.
			
			This is particularly useful when the balloon is used only for passive feedback and 
			doesn't have to be dismissed. The user may want to perform some task quickly without having
			to wait the time specified in the <autoHideInterval> while the balloon is obstructing a page
			element.
			
		Syntax:
			object.autoAway [= bValue ]
			
		Possible Values:
			bValue - *boolean* true / false
		
		Examples:
			balloonObj.autoAway=true;
	*/	
	this.autoAway=autoAway;
	
	/*	Property: width
			Sets or retrieves a value of balloon's width. The height is dynamic, the width has to be specified.
			
		Syntax:
			object.width [= iValue ]
			
		Possible Values:
			iValue - *integer* the number of pixels.
		
		Examples:
			balloonObj.width=325;
	*/		
	this.width=blbWidth;
		
	/*	Property: showCloseBox
			Sets or retrieves a value of whether the close balloon (right-upper corner) should be displayed.
			It makes sense to turn <autoHide> off when enabling this feature.
			
		Syntax:
			object.showCloseBox [= bValue ]
			
		Possible Values:
			bValue - *boolean* true / false
		
		Examples:
			balloonObj.showCloseBox=false;
	*/	
	this.showCloseBox=showCloseBox;
	
	var childID;
	
	// Constructor
	var balloonDIV = document.createElement("DIV");
	balloonDIV.style.width=String(blbWidth);
	balloonDIV.style.position="absolute";
	balloonDIV.style.visibility="hidden";
	balloonDIV.style.filter=transShowFilter+' '+transHideFilter;
	balloonDIV.style.zIndex=2001;
	
	/*	Property: balloon
			Retrieves the reference to the instantiated balloon object.
			
		Syntax:
			[obj =] object.balloon
			
		Possible Values:
			obj - *object* balloon reference
		
		Examples:
			var obj = balloonObj.balloon;
	*/
	this.balloon=balloonDIV;

	// Pulic Methods
	this.Show=Show;
	this.Hide=Hide;
	
	/*	Function: Show
			Makes the instantiated balloon appear.
			

⌨️ 快捷键说明

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