Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Toggle driving me crazy in responsive design Re: Toggle driving me crazy in responsive design

#124358
Derek Wood
Participant

I was having the same issues. Listening to widow width with javaScript is problematic – so I made this to figure out the lightest way this could be done. It used media queries instead of javaScript to detect window and toggleClass() and falls back from jQuery gracefully. I hope it might help!

http://codepen.io/sheriffderek/pen/gDscn