$ 0 0 Its really hard to debug and understand the issue without code because there are multiple issues. Please put the working code online.You can use jsbin or plunker BR.