UNPKG

tiny-slider

Version:

Vanilla javascript slider for all purposes, inspired by Owl Carousel.

25 lines (20 loc) • 627 B
export function whichProperty(props){ if (typeof props === 'string') { var arr = [props], Props = props.charAt(0).toUpperCase() + props.substr(1), prefixes = ['Webkit', 'Moz', 'ms', 'O']; prefixes.forEach(function(prefix) { if (prefix !== 'ms' || props === 'transform') { arr.push(prefix + Props); } }); props = arr; } var el = document.createElement('fakeelement'), len = props.length; for(var i = 0; i < props.length; i++){ var prop = props[i]; if( el.style[prop] !== undefined ){ return prop; } } return false; // explicit for ie9- }