1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
---|
2 | <html> |
---|
3 | <head> |
---|
4 | <title>Test</title> |
---|
5 | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> |
---|
6 | <script type="text/javascript"> |
---|
7 | $(function () { |
---|
8 | $('#test a').hover(function () { |
---|
9 | $(this).closest('dt').next('dd').animate({ opacity: 1 }); |
---|
10 | }, function () { |
---|
11 | $(this).closest('dt').next('dd').animate({ opacity: 0.5 }); |
---|
12 | }); |
---|
13 | }); |
---|
14 | </script> |
---|
15 | <style> |
---|
16 | #test dt { |
---|
17 | width: 100px; |
---|
18 | text-align: right; |
---|
19 | float: left; |
---|
20 | } |
---|
21 | </style> |
---|
22 | </head> |
---|
23 | <body> |
---|
24 | <div id="test"> |
---|
25 | <dl> |
---|
26 | <dt><a href="#">ABC</a></dt> |
---|
27 | <dd>Description for ABC</dd> |
---|
28 | <dt><a href="#">DEF</a></dt> |
---|
29 | <dd>Description for DEF</dd> |
---|
30 | </dl> |
---|
31 | </div> |
---|
32 | </body> |
---|
33 | </html> |
---|