That's right. There's no duplicate property isOpen
. Use NOT isClosed
instead:
var is_west_open = ( ! lout.state.west.isClosed);
I am not ready to answer why is there no property isOpen (I dont watch on this js-library), but I'd like to give you 2 advices:
1) Use console.log(<variable>)
instead of alert(<variable>)
.
- First of all, it doesn't stop execution of the script, so you can see few log-messages at a time rather than clicking "OK" any time an
alert
happens;
- You can back to the previous message;
- Alert accepts a String, so any element provided is converted automatically with
toString()
method, so it is not exactly the same object that browser operate with;
2) Try to use Developer Tools in Google Chrome or Firebug (in Firefox) or, in Opera and IE their native inspectors - it can enshort the time you debug your application - they show you all the properties and methods available for an object
Just Click F12
and you'll can see something like this:
http://i.stack.imgur.com/JlSga.png