hashscroll extension - click listener fires on overthrow-element, not on a link #12

frequent opened this Issue Jun 6, 2012 · 0 comments


None yet
1 participant

frequent commented Jun 6, 2012

The hashscroll extension has the following listener:

  w.document.addEventListener( "click", function( e ){
        var link = e.target;
        if( link && link.className.indexOf( "throw" ) > -1 ){
             var hash = link.href.split( "#" )[ 1 ],
                   elem = w.document.getElementById( hash );

Shouldn't it call something likel JQM findClosestLink function to make sure the clicked element really is a link?

In my case I'm clicking inside a scrollable area, which sets e.target to my div.overthrow and thus passes the next if-check. But then trying to set hash as href.split from my div.overthrow, it throws an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment