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

index 52103d5e925f7ca0cd5e6bab3dfa4a2cf1255c01..f5f30a28864915832ce9974dbc76a4ef53df0abf 100644 (file)
@@ -33,6 +33,8 @@
                        canvas.height = 135;\r
                        var ctx = canvas.getContext("2d");\r
                        ctx.fillStyle = "black";\r
+                       ctx.strokeStyle = "white";\r
+                       \r
                        ctx.beginPath();\r
                        ctx.moveTo(10, 0);\r
                        ctx.quadraticCurveTo(0, 0, 0, 10);\r
                        ctx.lineTo(10, 0);\r
                        ctx.fill();\r
                        \r
-                       ctx.strokeStyle = "white";\r
                        ctx.beginPath();\r
                        ctx.moveTo(0, 100.5);\r
                        ctx.lineTo(100, 100.5);\r
                        ctx.stroke();\r
                        \r
-                       var mod = 2;\r
+                       ctx.lineWidth = 1.5;\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
+                       $.each(new Array(100), function(position) {\r
+                               ctx.lineTo(position, 100 - position * impl(0, position, 0, 1, 100));\r
                        });\r
                        ctx.stroke();\r
                        graph.click(function() {\r