Browser Support


SUBMITTED BY: Guest

DATE: March 21, 2014, 9:09 a.m.

FORMAT: JavaScript

SIZE: 791 Bytes

HITS: 3075

  1. function checkSupport(prop)
  2. {
  3. var div = document.createElement('div'),
  4. pref = 'Khtml Ms O Moz Webkit'.split(' '),
  5. len = pref.length;
  6. return (function(prop)
  7. {
  8. if(prop in div.style) return prop;
  9. prop = prop.replace(/^[a-z]/, function(val){
  10. return val.toUpperCase();
  11. });
  12. while(len--){
  13. if(pref[len] + prop in div.style ){
  14. return pref[len] + prop;
  15. }
  16. }
  17. return false;
  18. })(prop);
  19. }

comments powered by Disqus