2016年12月22日 星期四

(js)暫停transition

There's a much simpler solution. If you want to just stop the transition (and not pause it). Just set the css to current computed style. For example in a custom scrolling solution, where top is transitioned property.

// 重設(style)屬性
element.style.top=getComputedStyle(element).top;