please have a look at the below code :
$(document).ready(function () {
var defaults = {
duration: 4000,
easing: ''
};
$.fn.transition = function (properties, options) {
options = $.extend({}, defaults, options);
properties['webkitTransition'] = 'all ' + options.duration + 'ms ' + options.easing;
console.log(properties);
$(this).css(properties);
};
$('.element').transition({
background: 'red'
});
});
i was just reading through a famious article online and if you go to the section that says "Programmatic transitions" , u'll see what i am talking about , now when coding animations in css-3 i was used to the below syntex :
-webkit-transform: .3s;
-moz-transform: .3s;
-ms-transform: .3s;
-o-transform: .3s;
but when creating css-3 transitions , i see alot of stuff like below :
var transEndEventNames = {
WebkitTransition : 'webkitTransitionEnd',
MozTransition : 'transitionend',
OTransition : 'oTransitionEnd otransitionend',
transition : 'transitionend'
}
what is WebkitTransition
, MozTransition
etc ??
in the 1st example i have provided , what is webkitTransition
? although seemingly obvious , what these things mean , totally elude me as JS newbie.
would seriously appreciate a genuin ttemp to answwer my question .
EDIT :: : i just want an answer for the below question .
is Transition in JS equililent to transition is CSS-3 ?? Why the uppercase syntax . as somebody pointed out in the comments below , i get it that jquery added prefixes automatically.
Thank you.
Alex-Z.