Skip to content

Commit

Permalink
more docs around Modernizr.prefixed(). nice transitionEnd event name …
Browse files Browse the repository at this point in the history
…example from desandro. thxx.

ref #233
  • Loading branch information
paulirish committed May 22, 2011
1 parent 38e5101 commit 5a2e2e9
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions modernizr.js
Expand Up @@ -1043,13 +1043,25 @@ window.Modernizr = (function( window, document, undefined ) {
// Modernizr.prefixed('boxSizing') // 'MozBoxSizing'

// Properties must be passed as dom-style camelcase, rather than `box-sizing` hypentated style.
// return values will also be the camelCase variant, if you need to translate that to hypenated style use:
// str.replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-');
// Return values will also be the camelCase variant, if you need to translate that to hypenated style use:
// str.replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-');

// If you're trying to ascertain which transition end event to bind to, you might do something like...
// var transEndEventNames = {
// 'WebkitTransition' : 'webkitTransitionEnd',
// 'MozTransition' : 'transitionend',
// 'OTransition' : 'oTransitionEnd',
// 'msTransition' : 'msTransitionEnd', // maybe?
// 'transition' : 'transitionEnd'
// },
// transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ];

Modernizr.prefixed = function(prop){
return testPropsAll(prop, 'pfx');
}



// Remove "no-js" class from <html> element, if it exists:
docElement.className = docElement.className.replace(/\bno-js\b/, '')

Expand Down

0 comments on commit 5a2e2e9

Please sign in to comment.