fix issue #180 and fixed a bug in demos

Fixed a bug in demos/index.js (the new click function instead of
doClick).
Fixed issue #180.
Merge pull request #193 from catodique/master

fix issue #180 and fixed a bug in demos