Automattic / antiscroll

OS X Lion style cross-browser native scrolling on the web that gets out of the way.
1.07k stars 162 forks source link

Scroll Isolation #95

Open faeb187 opened 9 years ago

faeb187 commented 9 years ago

Feedback Seems nice! I give it a try!

Feature Request Wouldn't it be perfect if we could set that param which won't allow scroll bubbling? (e.g. Facebook where the chat window must be scrollable without the whole site is scrolling away when reached the bottom of the chat window)

#prevent scroll bubbling on .scroll-isolated
#using 'jquery-mousewheel' (git repository)
$( ".scroll-isolated" ).each ->
    $( @ ).on "mousewheel", ( e, dlta ) ->
        st = $( @ ).scrollTop()
        if ( !st and dlta > 0 ) or st is ( @scrollHeight - $( @ ).height() ) and dlta < 0 then e.preventDefault()

Update Switched to jquery.nicescroll !! Great plugin, no css file needed and scroll isolation implemented (nativeparentscrolling: !1)