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

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -