|
1 | | -<!doctype html> |
2 | | -<html lang="en"> |
3 | | -<head> |
4 | | - <title>jQuery UI Effects - Effect Demo</title> |
5 | | - <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" /> |
6 | | - <script type="text/javascript" src="../../jquery-1.3.2.js"></script> |
7 | | - <script type="text/javascript" src="../../ui/effects.core.js"></script> |
8 | | - <link type="text/css" href="../demos.css" rel="stylesheet" /> |
9 | | - <style type="text/css"> |
10 | | - .graph { |
11 | | - float: left; |
12 | | - margin-left: 10px; |
13 | | - } |
14 | | - </style> |
15 | | - <script type="text/javascript"> |
16 | | - $(function() { |
17 | | - if (!$("<canvas/>")[0].getContext) { |
18 | | - $("<div/>").text("Your browser doesn't support canvas, which is required for this demo. Give Firefox 3 a try!").appendTo("#graphs"); |
19 | | - return; |
20 | | - } |
21 | | - var i = 0; |
22 | | - var width = 100, |
23 | | - height = 100; |
24 | | - $.each($.easing, function(name, impl) { |
25 | | - // skip linera/jswing and any non functioning implementation |
26 | | - if (!$.isFunction(impl) || /linear|jswing/.test(name)) |
27 | | - return; |
28 | | - var graph = $("<div/>").addClass("graph").appendTo("#graphs"); |
29 | | - var text = $("<div/>").text(++i + ". " + name).appendTo(graph); |
30 | | - |
31 | | - var canvas = $("<canvas/>").appendTo(graph)[0] |
32 | | - canvas.width = width; |
33 | | - canvas.height = height; |
34 | | - var drawHeight = height * 0.75; |
35 | | - var cradius = 10; |
36 | | - var ctx = canvas.getContext("2d"); |
37 | | - ctx.fillStyle = "black"; |
38 | | - |
39 | | - ctx.beginPath(); |
40 | | - ctx.moveTo(cradius, 0); |
41 | | - ctx.quadraticCurveTo(0, 0, 0, cradius); |
42 | | - ctx.lineTo(0, height - cradius); |
43 | | - ctx.quadraticCurveTo(0, height, cradius, height); |
44 | | - ctx.lineTo(width - cradius, height); |
45 | | - ctx.quadraticCurveTo(width, height, width, height - cradius); |
46 | | - ctx.lineTo(width, 0); |
47 | | - ctx.lineTo(cradius, 0); |
48 | | - ctx.fill(); |
49 | | - |
50 | | - ctx.strokeStyle = "#555"; |
51 | | - ctx.beginPath(); |
52 | | - ctx.moveTo(0, drawHeight + .5); |
53 | | - ctx.lineTo(width, drawHeight + .5); |
54 | | - ctx.stroke(); |
55 | | - |
56 | | - ctx.strokeStyle = "white"; |
57 | | - ctx.lineWidth = 2; |
58 | | - ctx.beginPath(); |
59 | | - $.each(new Array(width), function(position) { |
60 | | - ctx.lineTo(position, drawHeight - position * impl(0, position, 0, 1, height) * 0.75); |
61 | | - }); |
62 | | - ctx.stroke(); |
63 | | - graph.click(function() { |
64 | | - $(canvas).animate({height: "hide"}, "slow", name).animate({"left": "0"}, 800).animate({height: "show"}, "slow", name); |
65 | | - }); |
66 | | - |
67 | | - graph.width(width).height(height + text.height() + 10); |
68 | | - //return false; |
69 | | - }); |
70 | | - }); |
71 | | - </script> |
72 | | -</head> |
73 | | -<body> |
74 | | - |
75 | | -<div class="demo"> |
76 | | - |
77 | | - <div id="graphs"></div> |
78 | | - |
79 | | - <div id="animted"></div> |
80 | | - |
81 | | -</div><!-- End demo --> |
82 | | - |
83 | | -<div class="demo-description"> |
84 | | - |
85 | | -<p><strong>All easings provided by jQuery UI are drawn above, using a HTLM canvas element</strong>. Click a diagram to see the easing in action.</p> |
86 | | - |
87 | | -</div><!-- End demo-description --> |
88 | | - |
89 | | -</body> |
90 | | -</html> |
91 | | -
|
| 1 | +<!doctype html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <title>jQuery UI Effects - Effect Demo</title> |
| 5 | + <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" /> |
| 6 | + <script type="text/javascript" src="../../jquery-1.3.2.js"></script> |
| 7 | + <script type="text/javascript" src="../../ui/effects.core.js"></script> |
| 8 | + <link type="text/css" href="../demos.css" rel="stylesheet" /> |
| 9 | + <style type="text/css"> |
| 10 | + .graph { |
| 11 | + float: left; |
| 12 | + margin-left: 10px; |
| 13 | + } |
| 14 | + </style> |
| 15 | + <script type="text/javascript"> |
| 16 | + $(function() { |
| 17 | + if (!$("<canvas/>")[0].getContext) { |
| 18 | + $("<div/>").text("Your browser doesn't support canvas, which is required for this demo. Give Firefox 3 a try!").appendTo("#graphs"); |
| 19 | + return; |
| 20 | + } |
| 21 | + var i = 0; |
| 22 | + var width = 100, |
| 23 | + height = 100; |
| 24 | + $.each($.easing, function(name, impl) { |
| 25 | + // skip linera/jswing and any non functioning implementation |
| 26 | + if (!$.isFunction(impl) || /linear|jswing/.test(name)) |
| 27 | + return; |
| 28 | + var graph = $("<div/>").addClass("graph").appendTo("#graphs"); |
| 29 | + var text = $("<div/>").text(++i + ". " + name).appendTo(graph); |
| 30 | + |
| 31 | + var canvas = $("<canvas/>").appendTo(graph)[0] |
| 32 | + canvas.width = width; |
| 33 | + canvas.height = height; |
| 34 | + var drawHeight = height * 0.75; |
| 35 | + var cradius = 10; |
| 36 | + var ctx = canvas.getContext("2d"); |
| 37 | + ctx.fillStyle = "black"; |
| 38 | + |
| 39 | + ctx.beginPath(); |
| 40 | + ctx.moveTo(cradius, 0); |
| 41 | + ctx.quadraticCurveTo(0, 0, 0, cradius); |
| 42 | + ctx.lineTo(0, height - cradius); |
| 43 | + ctx.quadraticCurveTo(0, height, cradius, height); |
| 44 | + ctx.lineTo(width - cradius, height); |
| 45 | + ctx.quadraticCurveTo(width, height, width, height - cradius); |
| 46 | + ctx.lineTo(width, 0); |
| 47 | + ctx.lineTo(cradius, 0); |
| 48 | + ctx.fill(); |
| 49 | + |
| 50 | + ctx.strokeStyle = "#555"; |
| 51 | + ctx.beginPath(); |
| 52 | + ctx.moveTo(0, drawHeight + .5); |
| 53 | + ctx.lineTo(width, drawHeight + .5); |
| 54 | + ctx.stroke(); |
| 55 | + |
| 56 | + ctx.strokeStyle = "white"; |
| 57 | + ctx.lineWidth = 2; |
| 58 | + ctx.beginPath(); |
| 59 | + $.each(new Array(width), function(position) { |
| 60 | + ctx.lineTo(position, drawHeight - position * impl(0, position, 0, 1, height) * 0.75); |
| 61 | + }); |
| 62 | + ctx.stroke(); |
| 63 | + graph.click(function() { |
| 64 | + $(canvas).animate({height: "hide"}, "slow", name).animate({"left": "0"}, 800).animate({height: "show"}, "slow", name); |
| 65 | + }); |
| 66 | + |
| 67 | + graph.width(width).height(height + text.height() + 10); |
| 68 | + //return false; |
| 69 | + }); |
| 70 | + }); |
| 71 | + </script> |
| 72 | +</head> |
| 73 | +<body> |
| 74 | + |
| 75 | +<div class="demo"> |
| 76 | + |
| 77 | + <div id="graphs"></div> |
| 78 | + |
| 79 | + <div id="animted"></div> |
| 80 | + |
| 81 | +</div><!-- End demo --> |
| 82 | + |
| 83 | +<div class="demo-description"> |
| 84 | + |
| 85 | +<p><strong>All easings provided by jQuery UI are drawn above, using a HTLM canvas element</strong>. Click a diagram to see the easing in action.</p> |
| 86 | + |
| 87 | +</div><!-- End demo-description --> |
| 88 | + |
| 89 | +</body> |
| 90 | +</html> |
| 91 | + |
0 commit comments