binding event listeners to conatiner div if specified