1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
2 | |
---|
3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
4 | <head> |
---|
5 | <title>jQuery animation bug test case</title> |
---|
6 | </head> |
---|
7 | <body> |
---|
8 | <h1>click on the blue div</h1> |
---|
9 | <p>for this test case to work <b>jquery-1.2.6.js must be in the same directory</b></p> |
---|
10 | |
---|
11 | <script type="text/javascript"> |
---|
12 | var html = [ |
---|
13 | '<html xmlns="http://www.w3.org/1999/xhtml">', |
---|
14 | '<head>', |
---|
15 | '<title></title>', |
---|
16 | '<script src="jquery-1.2.6.js" type="text/javascript"><\/script>', |
---|
17 | '</head>', |
---|
18 | '<body>', |
---|
19 | '<div id="testdiv" style="width: 100px; height: 100px; color: white; background-color: blue;">click on me</div>', |
---|
20 | '</body>', |
---|
21 | '</html>'].join("\n"); |
---|
22 | |
---|
23 | var iframe = document.createElement("iframe") |
---|
24 | iframe.setAttribute("id", "dynamiciframe"); |
---|
25 | iframe.setAttribute("name", "dynamiciframe"); |
---|
26 | document.body.appendChild(iframe); |
---|
27 | |
---|
28 | document.body.onload = function() { |
---|
29 | var iframe = window.frames["dynamiciframe"]; |
---|
30 | iframe.document.open(); |
---|
31 | iframe.document.write(html); |
---|
32 | |
---|
33 | iframe.document.body.onload = function() { |
---|
34 | var jQuery = iframe.window.jQuery; |
---|
35 | jQuery("#testdiv").click(function() { |
---|
36 | jQuery(this).fadeOut("slow", function() { |
---|
37 | alert("done!"); |
---|
38 | }); |
---|
39 | }); |
---|
40 | }; |
---|
41 | |
---|
42 | iframe.document.close(); |
---|
43 | }; |
---|
44 | </script> |
---|
45 | |
---|
46 | </body> |
---|
47 | </html> |
---|