Replace CSS transitions by JS