something mysteriously broke, added workaround

What happened was, $(this).attr('dir') stopped finding the
"dir" attribute of the given DIV tag, even though absolutely
nothing in the code changed.  (Maybe, browser updates changed
behavior?)  The solution was to use evt.target.getAttribute('dir')
instead.