webkit-transition

How do I get the -webkit-transition-duration property with jQuery?

余生颓废 提交于 2020-01-02 02:27:08
问题 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

HTML5 -webkit-transition doesn't work if I set it right before setting something else using javascript on chrome

匆匆过客 提交于 2019-12-25 04:58:08
问题 I'm still new to HTML5 but I faced a very strange behavior. (In Chrome) The following code works on chrome: <!DOCTYPE html> <html> <head> <title>Webkit-transition test</title> <script language="javascript" > function addSpan() { document.getElementById("someDiv").innerHTML = "<span id=\"t47\" >A new span!</span>"; document.getElementById("t47").className += "letter"; } function moveIt() { document.getElementById("t47").style["MozTransform"] = "translate(10px,40px)"; document.getElementById(

How do I get the -webkit-transition-duration property with jQuery?

♀尐吖头ヾ 提交于 2019-12-05 04:14:04
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. Nicocube Try with: $('#objectID').css('transition-duration','1s'); $('#objectID').css('transition-duration'); Simpler answer: parseFloat(getComputedStyle(targetElement)['transitionDuration']) Ohgodwhy function getTransitionProperty(element) { // Note that in some versions of IE9 it is critical that // msTransform appear in this list before MozTransform var properties