<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>JSBalloon Examples</title>
</head>
<script type="text/javascript" src="JSBalloon.js"></script>
<script language="JavaScript">
var bl=new JSBalloon({ width:300});
var b2=new JSBalloon();
var b3=new JSBalloon();
var b4=new JSBalloon({ width:150,
autoAway:false,
autoHide:false,
showCloseBox:true});
function testBalloon()
{
bl.autoHide=false;
bl.transShow=true;
bl.autoAway=false;
bl.showCloseBox=true;
bl.transShowFilter="progid:DXImageTransform.Microsoft.Stretch(stretchstyle=SPIN)";
bl.transHideFilter="progid:DXImageTransform.Microsoft.Slide(slidestyle=HIDE,Bands=1)";
bl.Show({title:'JavaScript Balloon Example',message:'This is an example of a JSBalloon object. It\'s primary application is to provide a modeless feedback to DHTML applications.',
anchor:B3, icon:'Info'});
}
function testBalloon1()
{
b2.Show({title:'JavaScript Balloon Example',message:'This is an example of a JSBalloon object. It\'s primary application is to provide a modeless feedback to DHTML applications.',
anchor:B3});
}
function testBalloon2()
{
b3.Show({message:'This is an example of a JSBalloon object. It\'s primary application is to provide a modeless feedback to DHTML applications. ',
anchor:B3});
}
function ConrerTest(obj)
{
b2.Show({title:String(obj.value),message:'Balloon test close to cornenrs.',
anchor:obj, icon:'Exclaim'});
}
// HTML Demo
function testHTML()
{
b4.transHide=false;
b4.Show({title:'HTML Example', message:'You may also use HTML.<p><b>Your Name:<b><br><input id="Demo1Text" type=text size=10> <input type=button value=OK onclick="Demo1()">',
anchor:B3});
document.all.Demo1Text.focus();
}
function Demo1()
{
b4.Hide();
alert('Hi ' + document.all.Demo1Text.value + '!');
}
// Anchor function
var currentBalloon=bl;
function TestAnchor()
{
alert(currentBalloon.balloon.outerHTML);
}
</script>
<body>
<table border="0" cellpadding="0" cellspacing="0" style="BORDER-COLLAPSE: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="50%">
<input type="button" style="WIDTH: 150px" value ="Left Corner Test" onmouseover="ConrerTest(this)" id=leftCorner name=leftCorner></td>
<td width="50%" align="right">
<input type="button" style="WIDTH: 150px" value ="Right Corner Test" onmouseover="ConrerTest(this)" id=rightCorner name=rightCorner></td>
</tr>
</table>
<select size="1" name="D1">
<option>Drop-down box dissapear test.</option>
</select><br>
<div align="center">
<center>
<table border="1" cellpadding="3" cellspacing="0" style="BORDER-COLLAPSE: collapse" bordercolor="#111111" width="80%">
<tr>
<td width="100%" bgcolor="#000080"><font face="Arial Black" color="#ffffff">
JSBalloon Examples<br>
</font></td>
</tr>
<tr>
<td width="100%">
<input type="button" style="WIDTH: 300px" value ="Example #1" name="B4" id=B5 onclick="testBalloon();currentBalloon=bl;"></td>
</tr>
<tr>
<td width="100%">Show icon, title, message and the close box. Don't auto
hide or auto move away.<br>
Demonstrate use of custom filters.</td>
</tr>
<tr>
<td width="100%">
<input type="button" style="WIDTH: 300px" value ="Example #2" onclick="testBalloon1();currentBalloon=b2;"></td>
</tr>
<tr>
<td width="100%">Show title and message only. Auto hide and auto away.
Default filters for show and hide.</td>
</tr>
<tr>
<td width="100%">
<input type="button" style="WIDTH: 300px" value ="Example #3" onclick="testBalloon2();currentBalloon=b3;"></td>
</tr>
<tr>
<td width="100%">Show message only. Auto hide and auto away. Default filters
for show and hide.</td>
</tr>
<tr>
<td width="100%">
<input type="button" style="WIDTH: 300px" value ="Example #4" onclick="testHTML();currentBalloon=b4;"></td>
</tr>
<tr>
<td width="100%">Show title, message and the close box. Don't auto
hide or auto move away.<br>
Demonstrate the use of HTML in the message body.</td>
</tr>
</table>
</center>
</div>
<DIV></DIV>
<div style="BORDER-RIGHT: 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: 1px solid; PADDING-LEFT: 4px; LEFT: 254px; PADDING-BOTTOM: 1px; OVERFLOW: auto; BORDER-LEFT: 1px solid; WIDTH: 400px; PADDING-TOP: 1px; BORDER-BOTTOM: 1px solid; POSITION: absolute; TOP: 376px; HEIGHT: 200px; BACKGROUND-COLOR: #ffffcc">
<p> <input style="LEFT: 200px; POSITION: relative; TOP: 50px" type="button" value="Balloon Anchor" name="B3" id=B3 onclick="TestAnchor();"></p>
<p> </p>
<p>
<pre>This button is placed in this area to provide an example
of an element housed in an absolutely posiitoned element that also scrolls.
Scroll left or right, up or down and click an example button above.
Note that balloons will not follow target.</pre>
<p> </p>
<p> </p>
</div>
</body>
</html>
评论0