FAQs

Why would I use SimpleStateManager rather than Media Queries?

Media Queries allow you to change the way a site looks based upon a number of conditions, in contrast, SimpleStateManager allows you to change the functionality of your site. In this way, both Media Queries and SimpleStateManager compliment one another, as in the situation where you are changing the look of your site you might also be changing functionality.

What does SimpleStateManager offer me over simply using the MatchMedia API?

The MatchMedia API is incredibly powerful as it allows us to use media queries in our JavaScript, when the media query is matched or unmatched a callback method is run. SimpleStateManager puts this functionality on steroids, providing you with a simple API to attach enter, leave and resize events to a state. In addition to using the matchMedia API it also allows you to specify additional rules your state must meet to be active.

What browsers does SimpleStateManager support?

Version 3.x of SimpleStateManager and above supports the following browsers:

Internet Explorer 10+ (Should work in IE9 if you provide a matchMedia polyfill)

Google Chrome

Mozilla Firefox

Opera

Apple Safari

The library has a suite of unit tests covering the core functionality, after every commit these are run in all browsers we support using a combination of TravisCI and BrowserStack. Aside from the unit tests, the library is also tested manually prior to each release.

If you need to support Internet Explorer 8 or below their are two options available: