Skip to content
Advertisement

How to change nav-link to btn on window resize with jquery?

I want to transform nav bar links from nav-link into btn on window resize. When the windows size >=601 – the nav-item change. But the problem is when the width goes bigger than 600. The nav link is not toggle the nav-link class.

JavaScript
JavaScript

I want the nav-item to transform between nav-link and btn on resize.

Please find the fiddle here : https://jsfiddle.net/m6r71gp0/

Advertisement

Answer

I don’t know what might be the problem at your end. May be you were adding and removing classes in wrong order. Check this out and let me know.

JavaScript
JavaScript

JSFiddle: https://jsfiddle.net/dL4361x2/1/

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement