1.简单弹出框:
<html>
<head>
<title>Popup1</title>
<object id="SGWorld" classid="CLSID:3a4f91b1-65a8-11d5-85c1-0001023952c1" style="visibility:hidden;height:0 "></object>
<script type="text/javascript">
function Init()
{
var popup = SGWorld.Creator.CreatePopupMessage("My popup", "http://www.yahoo.com");
SGWorld.Window.ShowPopup(popup);
}
</script>
</head>
<body onload="Init();">
</body>
</html>
<head>
<title>Popup1</title>
<object id="SGWorld" classid="CLSID:3a4f91b1-65a8-11d5-85c1-0001023952c1" style="visibility:hidden;height:0 "></object>
<script type="text/javascript">
function Init()
{
var popup = SGWorld.Creator.CreatePopupMessage("My popup", "http://www.yahoo.com");
SGWorld.Window.ShowPopup(popup);
}
</script>
</head>
<body onload="Init();">
</body>
</html>
2.弹出框的尺寸和位置:
<html>
<head>
<title>Popup2</title>
<object id="SGWorld" classid="CLSID:3a4f91b1-65a8-11d5-85c1-0001023952c1" style="visibility:hidden;height:0 "></object>
<script type="text/javascript">
function Init()
{
var popup = SGWorld.Creator.CreatePopupMessage("My popup", "http://www.yahoo.com",0,0);
popup.Height = 160;
popup.Width = SGWorld.Window.Rect.Width;
//popup.Align = "bottom";
SGWorld.Window.ShowPopup(popup);
}
</script>
</head>
<body onload="Init();">
</body>
</html>
<head>
<title>Popup2</title>
<object id="SGWorld" classid="CLSID:3a4f91b1-65a8-11d5-85c1-0001023952c1" style="visibility:hidden;height:0 "></object>
<script type="text/javascript">
function Init()
{
var popup = SGWorld.Creator.CreatePopupMessage("My popup", "http://www.yahoo.com",0,0);
popup.Height = 160;
popup.Width = SGWorld.Window.Rect.Width;
//popup.Align = "bottom";
SGWorld.Window.ShowPopup(popup);
}
</script>
</head>
<body onload="Init();">
</body>
</html>
3.简单文本弹出框:
<html>
<head>
<title>Popup3</title>
<object id="SGWorld" classid="CLSID:3a4f91b1-65a8-11d5-85c1-0001023952c1" style="visibility:hidden;height:0 "></object>
<script type="text/javascript">
function Init()
{
var popup = SGWorld.Creator.CreatePopupMessage("My popup");
popup.innerText = "Did you know:\r\nYou can have multiple popup messages by giving them different caption.\r\nPopup messages with the same caption, replaces each other.";
SGWorld.Window.ShowPopup(popup);
}
</script>
</head>
<body onload="Init();">
</body>
</html>
<head>
<title>Popup3</title>
<object id="SGWorld" classid="CLSID:3a4f91b1-65a8-11d5-85c1-0001023952c1" style="visibility:hidden;height:0 "></object>
<script type="text/javascript">
function Init()
{
var popup = SGWorld.Creator.CreatePopupMessage("My popup");
popup.innerText = "Did you know:\r\nYou can have multiple popup messages by giving them different caption.\r\nPopup messages with the same caption, replaces each other.";
SGWorld.Window.ShowPopup(popup);
}
</script>
</head>
<body onload="Init();">
</body>
</html>
4.在指定时间后消失的无标题弹出框:
<html>
<head>
<title>Popup4</title>
<object id="SGWorld" classid="CLSID:3a4f91b1-65a8-11d5-85c1-0001023952c1" style="visibility:hidden;height:0 "></object>
<script type="text/javascript">
function Init()
{
// passing empty caption will turn caption off. You can also turn caption on/off using ShowCaption property of popup.
var popup = SGWorld.Creator.CreatePopupMessage("", "", 0, 0, 300, 50, 5000);
popup.InnerText = "This is a simple text popup without a caption.\r\nIt will be displayed for 5 seconds";
popup.Align = "BottomLeft";
SGWorld.Window.ShowPopup(popup);
}
</script>
</head>
<body onload="Init();">
</body>
</html>
<head>
<title>Popup4</title>
<object id="SGWorld" classid="CLSID:3a4f91b1-65a8-11d5-85c1-0001023952c1" style="visibility:hidden;height:0 "></object>
<script type="text/javascript">
function Init()
{
// passing empty caption will turn caption off. You can also turn caption on/off using ShowCaption property of popup.
var popup = SGWorld.Creator.CreatePopupMessage("", "", 0, 0, 300, 50, 5000);
popup.InnerText = "This is a simple text popup without a caption.\r\nIt will be displayed for 5 seconds";
popup.Align = "BottomLeft";
SGWorld.Window.ShowPopup(popup);
}
</script>
</head>
<body onload="Init();">
</body>
</html>
5.最大化弹出框:
<html>
<head>
<title>Popup5</title>
<object id="SGWorld" classid="CLSID:3a4f91b1-65a8-11d5-85c1-0001023952c1" style="visibility:hidden;height:0 "></object>
<script type="text/javascript">
function Init()
{
var popup = SGWorld.Creator.CreatePopupMessage("Article", "http://www.yahoo.com",5,5);
popup.Width = SGWorld.Window.Rect.Width-10;
popup.Height = SGWorld.Window.Rect.Height-10;
SGWorld.Window.ShowPopup(popup);
}
</script>
</head>
<body onload="Init();">
</body>
</html>
<head>
<title>Popup5</title>
<object id="SGWorld" classid="CLSID:3a4f91b1-65a8-11d5-85c1-0001023952c1" style="visibility:hidden;height:0 "></object>
<script type="text/javascript">
function Init()
{
var popup = SGWorld.Creator.CreatePopupMessage("Article", "http://www.yahoo.com",5,5);
popup.Width = SGWorld.Window.Rect.Width-10;
popup.Height = SGWorld.Window.Rect.Height-10;
SGWorld.Window.ShowPopup(popup);
}
</script>
</head>
<body onload="Init();">
</body>
</html>
6.弹出框的尺寸和位置 (2):
<html>
<head>
<title>Popup6</title>
<object id="SGWorld" classid="CLSID:3a4f91b1-65a8-11d5-85c1-0001023952c1" style="visibility:hidden;height:0 "></object>
<script type="text/javascript">
function Init()
{
var popup = SGWorld.Creator.CreatePopupMessage("Custom position and dimensions (displayed for 10 sec)", "http://www.yahoo.com", -100, 300, 500, 200, 10000);
SGWorld.Window.ShowPopup(popup);
}
</script>
</head>
<body onload="Init();">
</body>
</html>
<head>
<title>Popup6</title>
<object id="SGWorld" classid="CLSID:3a4f91b1-65a8-11d5-85c1-0001023952c1" style="visibility:hidden;height:0 "></object>
<script type="text/javascript">
function Init()
{
var popup = SGWorld.Creator.CreatePopupMessage("Custom position and dimensions (displayed for 10 sec)", "http://www.yahoo.com", -100, 300, 500, 200, 10000);
SGWorld.Window.ShowPopup(popup);
}
</script>
</head>
<body onload="Init();">
</body>
</html>
7.移除弹出框:
<html>
<head>
<title>Popup7</title>
<object id="SGWorld" classid="CLSID:3a4f91b1-65a8-11d5-85c1-0001023952c1" style="visibility:hidden;height:0 "></object>
<script type="text/javascript">
function Init()
{
var popup = SGWorld.Creator.CreatePopupMessage();
popup.InnerText = "This sample shows how to programmatically remove the popup";
popup.Align = "Top";
SGWorld.Window.ShowPopup(popup);
alert("Click OK to remove the popup");
SGWorld.Window.RemovePopup(popup);
}
</script>
</head>
<body onload="Init();">
</body>
</html>
<head>
<title>Popup7</title>
<object id="SGWorld" classid="CLSID:3a4f91b1-65a8-11d5-85c1-0001023952c1" style="visibility:hidden;height:0 "></object>
<script type="text/javascript">
function Init()
{
var popup = SGWorld.Creator.CreatePopupMessage();
popup.InnerText = "This sample shows how to programmatically remove the popup";
popup.Align = "Top";
SGWorld.Window.ShowPopup(popup);
alert("Click OK to remove the popup");
SGWorld.Window.RemovePopup(popup);
}
</script>
</head>
<body onload="Init();">
</body>
</html>