diff --git a/jquery.transit.js b/jquery.transit.js index 96458cb..ed92fc5 100644 --- a/jquery.transit.js +++ b/jquery.transit.js @@ -449,6 +449,10 @@ key = $.transit.propertyMap[key] || $.cssProps[key] || key; key = uncamel(key); // Convert back to dasherized + if (key === 'transform' && support.transform === 'WebkitTransform') { + key = '-webkit-transform' + } + if ($.inArray(key, re) === -1) { re.push(key); } }); diff --git a/test/index.html b/test/index.html index 7a847a8..ac4a924 100644 --- a/test/index.html +++ b/test/index.html @@ -33,6 +33,7 @@
Use: + jQ 2.0.3 jQ 1.9.0b1 jQ 1.8 jQ 1.7 @@ -157,6 +158,12 @@

jQuery transit tests

.transition({ opacity: 0 }); }); + test('Transition of transform (no jump first time)', function($box) { + $box + .transition({ transform: "translateX(80px)" }); + }); + + diff --git a/test/test.js b/test/test.js index ed88d03..a015441 100644 --- a/test/test.js +++ b/test/test.js @@ -1,25 +1,31 @@ (function($) { /* Simple test framework of sorts */ - $('.test').live('mouseenter play', function() { - var $test = $(this).closest('.test'); - $test.trigger('reset'); - var $box = $test.find('.box:not(.ghost)'); - var $ghost = $box.clone().addClass('ghost').appendTo($test.find('.area')); - $test.data('code').fn($box, $test); - }); - $('.test').live('mouseleave reset', function() { - var $test = $(this).closest('.test'); - var $ghost = $test.find('.ghost'); - if ($ghost.length) { - $test.find('.box:not(.ghost)').remove(); - $test.find('.ghost').removeClass('ghost'); - } - }); - - $('.play-all').live('click', function() { - $('.test').trigger('play'); + function addTestEvents ($test) { + $test.bind('mouseenter play', function() { + var $test = $(this).closest('.test'); + $test.trigger('reset'); + var $box = $test.find('.box:not(.ghost)'); + var $ghost = $box.clone().addClass('ghost').appendTo($test.find('.area')); + + $test.data('code').fn($box, $test); + }); + + $test.bind('mouseleave reset', function() { + var $test = $(this).closest('.test'); + var $ghost = $test.find('.ghost'); + if ($ghost.length) { + $test.find('.box:not(.ghost)').remove(); + $test.find('.ghost').removeClass('ghost'); + } + }); + } + + $(document).ready(function () { + $('.play-all').bind('click', function() { + $('.test').trigger('play'); + }); }); function test(name, fn) { @@ -36,6 +42,7 @@ $test.find('h3').html(name); $test.find('pre').text(code); $test.data('code', {fn: fn}); + addTestEvents($test); $('.tests').append($test); }