Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions jquery.transit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
});

Expand Down
7 changes: 7 additions & 0 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<body>
<div class='use'>
Use:
<a href='index.html?jquery=2.0.3'>jQ 2.0.3</a>
<a href='index.html?jquery=1.9.0b1'>jQ 1.9.0b1</a>
<a href='index.html?jquery=1.8.1'>jQ 1.8</a>
<a href='index.html?jquery=1.7.0'>jQ 1.7</a>
Expand Down Expand Up @@ -157,6 +158,12 @@ <h1>jQuery transit tests</h1>
.transition({ opacity: 0 });
});

test('Transition of transform (no jump first time)', function($box) {
$box
.transition({ transform: "translateX(80px)" });
});


</script>
</body>
</html>
43 changes: 25 additions & 18 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand All @@ -36,6 +42,7 @@
$test.find('h3').html(name);
$test.find('pre').text(code);
$test.data('code', {fn: fn});
addTestEvents($test);

$('.tests').append($test);
}
Expand Down