Tsallaka zuwa abun ciki
Justice Tech School

CSS vs jQuery Animation

Prefer CSS transitions for simple effects and toggle a class.

Example
$("#menu").toggleClass("open");
// CSS: #menu { transition: height .3s } #menu.open { height: 200px }

Exercise

Toggle class.

$("m").toggle("open")

Quiz Test

Why prefer CSS transitions?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.