Added option to change duration of animation.

Animation duration has been set as a property to the widget.
The default value is still 400, but now it can be changed with setDuration(value)