overLIB 是一个生成提示框与弹出菜单等页面效果的一段非常优秀的JS代码。
它可以简单的通过设置一些参数或命令来改变弹出页面的款式、皮肤与形状,不但如此,它还提供了非常简单的扩展功能,来足客户的不同需求。
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);" οnmοuseοver="return overlib('这是一个popup.');" οnmοuseοut="return nd();">popup示例</a>
<a href="javascript:void(0);" οnmοuseοver="return overlib('这是一个sticky',STICKY, MOUSEOFF);" οnmοuseοut="return nd();">stick示例 </a>
四、 命令与参数
popup
Attribute Name | Type | Required | Default | Description |
---|---|---|---|---|
text | string | Yes | n/a | the text/html to display in the popup window |
trigger | string | No | onMouseOver | What is used to trigger the popup window. Can be one of onMouseOver or onClick |
sticky | boolean | No | false | Makes the popup stick around until closed |
caption | string | No | n/a | sets the caption to title |
fgcolor | string | No | n/a | color of the inside of the popup box |
bgcolor | string | No | n/a | color of the border of the popup box |
textcolor | string | No | n/a | sets the color of the text inside the box |
capcolor | string | No | n/a | sets color of the box's caption |
closecolor | string | No | n/a | sets the color of the close text |
textfont | string | No | n/a | sets the font to be used by the main text |
captionfont | string | No | n/a | sets the font of the caption |
closefont | string | No | n/a | sets the font for the "Close" text |
textsize | string | No | n/a | sets the size of the main text's font |
captionsize | string |