Nereo Costacurta
Nereo Costacurta

Reputation: 8541

jquery bind transitionend when not supported

How can I handle the bind transitionend on browsers that don't support it?

If I have

$('#div').bind('transitionend', function(){...});
$('#div').css('width','100px'); //this will start transition if supported

How can I make it working in ie8? I tried to make a string which contains "transitionend" if the browser support it, and "change" if not, but i think it's not a good idea.

var transitionstring = 'transitionend';
if (IE) transitionstring = 'change';
//bind custom handler
$('#div').bind(transitionstring , function(){...});
$('#div').css('width','100px'); //this will start transition if supported, else
//the change event will be triggered

Any suggestion?

Upvotes: 0

Views: 600

Answers (1)

Einacio
Einacio

Reputation: 3532

you can try adding a custom trigger on css using cssHooks

example http://jsbin.com/UgiCUd/

Upvotes: 0

Related Questions