I have a small script that changes a div-list into a accordion on a specific (browser) width.
if ($(window).width() < 768) {
$( "#footerWidgets" ).accordion();
} else {
}
It all works fine, but the problem is that when the user views the website on a small screen and increases the browser width (or changes phone to landscape), it won’t change back to it’s default non accordion position. Wish in result messes up the intire layout. How can I make this possible?
You could put it in the resize function: