jakiestfu / Snap.js

A Library for creating beautiful mobile shelfs in Javascript (Facebook and Path style side menus)
http://jakiestfu.github.io/Snap.js/
5.99k stars 663 forks source link

Settings update [docs] #219

Open yumyo opened 10 years ago

yumyo commented 10 years ago

I've managed to combine snap.js with enquire.js to dinamically update drawer's width. While working on this setup I found that settings need to be called like:

snapper.settings.maxPosition = 123;

and the same goes for the state property:

var data = snapper.state();
if (data.state == "right") {
  snapper.close();
}

Docs are not clear about that, at least for me. So, while this may be obvious for some senior js dev, I'm sharing my findings for the rest of us ; )