]> 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:03:48 +0000 (21:03 +0000)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Thu, 23 Apr 2009 21:03:48 +0000 (21:03 +0000)
demos/effect/easing.html

index 043c4caa8c53e673c0ceb48221f23995b1625d96..34ab83cc557e579c466a3c29b0334d92cb752e5a 100644 (file)
                }\r
                var i = 0;\r
                $.each($.easing, function(name, impl) {\r
-                       if (!$.isFunction(impl))\r
+                       // skip linera/jswing and any non functioning implementation\r
+                       if (!$.isFunction(impl) || /linear|jswing/.test(name))\r
                                return;\r
                        var graph = $("<div/>").addClass("graph").appendTo("#graphs");\r
                        $("<div/>").text(++i + ". " + name).appendTo(graph);\r
+                       \r
                        var canvas = $("<canvas/>").appendTo(graph)[0]\r
                        canvas.width = 100;\r
                        canvas.height = 100;\r
@@ -56,7 +58,9 @@
                                ctx.moveTo(index * 10 + 10.5, 96);\r
                                ctx.lineTo(index * 10 + 10.5, 100);\r
                                ctx.stroke();\r
-                       })\r
+                       });\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
@@ -84,7 +88,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. "linear" and "jswing" aren't rendered properly, but work, too.</p>\r
+<p>All easings provided by jQuery UI are drawn above. Click a diagram to see the easing in action.</p>\r
 \r
 </div><!-- End demo-description -->\r
 \r