]> source.dussan.org Git - jquery-ui.git/commitdiff
effects: demo visualising easing functions, tuning
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Thu, 23 Apr 2009 21:37:07 +0000 (21:37 +0000)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Thu, 23 Apr 2009 21:37:07 +0000 (21:37 +0000)
demos/effect/easing.html

index 34ab83cc557e579c466a3c29b0334d92cb752e5a..72f535f67181220bb2de4dd7adc1c8838d996a32 100644 (file)
                        });\r
                        \r
                        // needs higher precision for better graphs\r
-                       $.each(new Array(100), function(position) {\r
-                               var mod = impl(0, position, 0, 1, 100);\r
-                               ctx.beginPath();\r
-                               ctx.moveTo(position, 100 - position * mod);\r
-                               ctx.lineTo(position + 1, 99 - position * mod);\r
-                               ctx.stroke();\r
+                       var mod = 2;\r
+                       ctx.beginPath();\r
+                       $.each(new Array(100 * mod), function(position) {\r
+                               var ease = impl(0, position, 0, 1, 100 * mod);\r
+                               ctx.moveTo(position / mod, 100 - position / mod * ease);\r
+                               ctx.lineTo(position / mod + 1, 99 - position / mod * ease);\r
                        });\r
+                       ctx.stroke();\r
                        graph.click(function() {\r
                                $(canvas).animate({height: "hide"}, "slow", name).animate({height: "show"}, "slow", name);\r
                        });\r
@@ -88,7 +89,7 @@
 \r
 <div class="demo-description">\r
 \r
-<p>All easings provided by jQuery UI are drawn above. Click a diagram to see the easing in action.</p>\r
+<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>\r
 \r
 </div><!-- End demo-description -->\r
 \r