overLIB的用法与示例(提示框与弹出菜单)


摘自: http://www.adminxiazai.com/article/web/javascript/1969.html

overLIB 使用非常的简单。
一、在<head></head> 标签内添加: <script type="text/javascript" src="overlib.js"><!-- overLIB (c) Erik Bosrup --></script>

二、在<body></body>标签内添加:<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div> 4.10以上的版本可省略此步
三、生成两种不同款式(popup与sticky)的弹出页面
  <a href="javascript:void(0);" onmouseover="return overlib('这是一个popup.');" onmouseout="return nd();">popup示例</a>
  <a href="javascript:void(0);" onmouseover="return overlib('这是一个sticky',STICKY, MOUSEOFF);" onmouseout="return nd();">stick示例 </a>
四、 命令与参数
  overLIB 可以接受任意个命令和参数。格式如下:命令[,'命令参数']
<a href="javascript:void(0);" onclick="return overlib('This is a sticky   with a caption. And it is centered under the mouse!', STICKY, CAPTION,
   'Sticky!', CENTER);" onmouseout="nd();">Click here!</a>
五、   overlib的一些使用示例

以下为引用的内容:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<script language="JavaScript" src="overlib.js"></script><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<a href="#" onclick="return overlib('使用overlib的命令', CAPTION, '这是Caption命令,就是生成头部',HAUTO);""  onmouseout="return nd();" >弹出测试</a>
<a href="javascript:void(0);" onmouseover="return overlib('This is an ordinary  popup.',CLOSECLICK);" onmouseout="return nd();">here</a>
<a href="javascript:void(0);" onmouseover="return overlib('This is what  we call a sticky, since I stick around (it goes away if you move the mouse  OVER and then OFF the overLIB popup--or mouseover another overLIB).',  STICKY, MOUSEOFF);" onmouseout="return nd();">吸附性的提示框</a>
<a href="javascript:void(0);" onclick="return overlib('This is a sticky   with a caption. And it is centered under the mouse!', STICKY, CAPTION,'Sticky!',CENTER);">含CAPTION的STICKY!</a>
<a href="javascript:void(0);" onclick="return overlib('Setting size and posiztion!', STICKY, CAPTION,'Sticky!',HEIGHT, 100,WIDTH,120,LEFT);">指定大小与位置弹出</a>
<a href="javascript:void(0);" onclick="return overlib('Setting size and posiztion!', STICKY, CAPTION,'Sticky!',STATUS ,'Hello');">设置状态栏</a>
</body>
</html>



六、自定义overlib。overlib有三种方式可以实现自定义。
  1、我们上面用过的通过输入不同命令来实现自定义。
  2、修改overlib.js中的默认值来实现自定义
  3、在引用的页面指定变量来实现自定义。

overlib实例下载:
/uploads/soft/200907/1_14090306.rar


下载 http://www.bosrup.com/web/overlib/?Download
更多使用请参考
http://www.bosrup.com/web/overlib/?Homepage

你可能感兴趣的:(JavaScript,html,C++,c,Web)