Enabled strict mode and fixed code to work.
When using container, set visibility based on $element.parent() visibility.
Fix #143.
Fixes #144.