Would using `$('.CodeMirror').offset().top` be sufficient to fix this?