If you replace X and Y with left and top, you can clean up a few things in this code in clever ways. Example:

```
this.codeSnippetPosition = this.$elem.offset();
```