1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
---|
2 | "http://www.w3.org/TR/html4/strict.dtd"> |
---|
3 | <html> |
---|
4 | <head> |
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
---|
6 | <title></title> |
---|
7 | <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"> </script> |
---|
8 | <script type="text/javascript"> |
---|
9 | $(function(){ |
---|
10 | function hoverin(){ |
---|
11 | $(this).animate({paddingRight:"+=100px"}) |
---|
12 | } |
---|
13 | function hoverout(){ |
---|
14 | $(this).animate({paddingRight:"-=100px"}) |
---|
15 | } |
---|
16 | $("#d").hover(hoverin, hoverout) |
---|
17 | }) |
---|
18 | </script> |
---|
19 | <style type="text/css"> |
---|
20 | #d { |
---|
21 | width:20%; |
---|
22 | position:absolute; |
---|
23 | left:0; top:1em; |
---|
24 | background-color:#CCC; |
---|
25 | color:#000; |
---|
26 | padding:2em; |
---|
27 | } |
---|
28 | #ta { |
---|
29 | width:20%; |
---|
30 | height:300px; |
---|
31 | margin-left:20%; |
---|
32 | } |
---|
33 | #ti { |
---|
34 | vertical-align:top; |
---|
35 | font-size:2em; |
---|
36 | margin-top:4.5em; |
---|
37 | } |
---|
38 | </style> |
---|
39 | </head> |
---|
40 | <body> |
---|
41 | <div id="d">Hover from div to textarea, div to page, page to div, and textarea to div.</div> |
---|
42 | <textarea id="ta"></textarea> |
---|
43 | <input id="ti" type="text"/> |
---|
44 | </body> |
---|
45 | </html> |
---|