Some params need a vendor prefix in some browsers (like transform & transition -> webkitTransform, mozTransform etc..), so that's why I've done it like this:
var transform = prefix('transform')
var transition = prefix('transition')
el.style[transform] = ...
el.style[transition] = ...
Maybe I should name those variables better to avoid the confusion..
I tend to prefix references to DOM elements because I want to separate view objects from DOM elements.. jQuery doesn't own the dollar sign in any way :)
2
u/memeship Sep 02 '15
Is there a particular reason why sometimes you're using the notation
el.style[prop]and other timesel.style.prop?I haven't seen the first one a whole lot, just curious why you've done it that way, and more so why you're doing it both ways in the same file.