MouseEvent behaves strangely when developer tool window is closed

I am developing a flask application with html and javascript for web interface. The application behaves strangely in Mouse events when developer tool is open the mouse press event happens at the position clicked but when closed the response is at a point different than the one clicked. I have removed console.log statements,still the behaviour persist. How can i fix this error?
-swetha