css - Detect support for transition with JavaScript -


i want serve different javascript files depending on if browser supports css3 transition or not. there better way detect transition support code below?

window.onload = function () {     var b = document.body.style;     if(b.moztransition=='' || b.webkittransition=='' || b.otransition=='' || b.transition=='') {         alert('supported');     } else {         alert('not supported')     } } 

modernizr detect you. use this link create custom download build contains css3 2d and/or 3d transitions.

once it's run, can either test csstransitions class on html tag (css), or in javascript, test if modernizr.csstransitions true.

more docs: http://modernizr.com/docs/#csstransitions


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

javascript - Preserving URL fragment through CAS sign-on -

asp.net mvc - Implementing normal user/pass, Twitter & Facebook auth -