?? webresource.js
字號:
/*----------------------------------------------------------------------------\
| 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=false;
var autoHideInterval=4000; // 4 sec
var autoAway=false;
var showCloseBox=true;
var anchor = event.srcElement;
/*
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;
}
if(oArg.anchor!=null)
{
anchor = oArg.anchor;
}
}
*/
// 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.position="absolute";
balloonDIV.style.visibility="hidden";
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;
this.title;
this.message;
// Pulic Methods
this.Show=Show;
this.Hide=Hide;
/* Function: Show
Makes the instantiated balloon appear.
Balloon content note:
Because SELECT objects are what's known as windowed controles
they need to be hidden when balloons are shown, otherwise they will always be on top
(they ignore zIndex attribute). It is normally done automatically by this control.
Sometimes, however, you may want to place a drop-down inside the balloon itself.
To override this default behaviour add an balloonMember expando attirbute to
the SELECT you are placing withing.
- e.g. <SELECT id=select1 name=select1 balloonMember=true>
Syntax:
(start code)
object.Show({[title:vTitle]
[,message:vMessage]
[,footer:vFooter]
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -