YUI学习(1):ToolTip的用法
最近在学习YUI,看了一些浪子先生的文章,感觉不错,不过最近估计浪子太忙了,好像一直没怎么更新YUI这部分,笔者也开始学习它,虽然有些吃力,但是先拿软柿子捏吧,就来ToolTip吧。
构造函数非常简单,第一个是ID,第二个是一个对象,里面有一些配置,重要的是Context(上下文结点的ID)。好啦 全文如下:
单击此处下载代码
构造函数非常简单,第一个是ID,第二个是一个对象,里面有一些配置,重要的是Context(上下文结点的ID)。好啦 全文如下:
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
<html>
3
<head>
4
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5
<title>Untitled Document</title>
6
<script type="text/javascript" src="yahoo.js"></script>
7
<script type="text/javascript" src="event.js"></script>
8
<script type="text/javascript" src="dom.js"></script>
9
<script type="text/javascript" src="container.js"></script>
10
<link rel="stylesheet" type="text/css" href="container.css" />
11
<script type="text/javascript">
12
var tooltip1;
13
14
</script>
15
</head>
16
<body>
17
<script>tooltip1 = new YAHOO.widget.Tooltip("tt1", { context:"link" } ); </script>
18
<a id="link" href="http://www.yahoo.com" title="I'm a link! I go to another page!" alt="">Hover over me too!</a>
19
</body>
20
</html>
21![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
可以看出,重要的一点是:![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
2
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
3
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
4
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
5
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
6
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
7
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
8
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
9
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
10
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
11
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
12
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
13
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
14
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)
15
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
16
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
17
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
18
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
19
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
20
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
21
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
tooltip1 = new YAHOO.widget.Tooltip("tt1", { context:"link" } );
关于那个配置对象,笔者找了半天也没找到相关文档,希望哪位朋友找到了告诉我一下,谢谢!单击此处下载代码