0

JavaScript concept of "toggle" while doing nav Bar

I want to understand how to use js in oder to make my nav-menu responsive and interactive on mobile

9th Mar 2025, 11:29 PM
Ermias Kebede
Ermias Kebede - avatar
2 ответов
+ 1
toggle is basically just if else condition checking... pseudocode: using ternary expression: function toggle(){ el.property = el.property==this ? that : this } or using if-else: function toggle(){ if (el.property == this) el.property = that else el.property = this }
10th Mar 2025, 4:55 AM
Bob_Li
Bob_Li - avatar