@joyfulljs/vendor-property
v1.0.1
Published
get browser vendor specific property name
Downloads
4
Readme
vendor-property
get browser vendor specific property name. currently only 'webkit' 'ms' 'moz' 'o' are in the list.
useage
import { getProperty, getEventProperty } from '@joyfulljs/vendor-property';
// use default property owner: document.body.style.
console.log(getProperty('transform'));
// output in lastest browser: transform
// output in old ie: msTransform
// use `window` as property owner
console.log(getProperty('requestAnimationFrame', window));
// output in lastest browser: requestAnimationFrame
// output in old chrome: webkitRequestAnimationFrame
console.log(getEventProperty('animationend'));
// output in lastest browser: animationend
// output in old chrome: webkitanimationend
note
getEventProperty
return event name that withouton
prefix, can be used directly inaddEventListener
.- It will return what passed in when the property is not in the owner.
license
MIT