How do I get the -webkit-transition-duration property with jQuery?
问题 Since this sets the transition duration to 1 second: $('#objectID').css('webkit-transition-duration','1s'); I assumed this would return the current duration value: $('#objectID').css('webkit-transition-duration'); but it does not. 回答1: Try with: $('#objectID').css('transition-duration','1s'); $('#objectID').css('transition-duration'); 回答2: Simpler answer: parseFloat(getComputedStyle(targetElement)['transitionDuration']) 回答3: function getTransitionProperty(element) { // Note that in some