javascript - SVG Blocks Touch/Mousewheel events -
is there workaround? running own custom scrollbar script opposed using built in browsers functionality. prefer use svg image elements number of reasons, one, pretty major pitfall fact touching or mousewheeling on svg blocks event , brings page scrolling halt. more noticeable on mobile browsers svg might take entire width of document in case svg element, user unable scroll past it.
i haven't tested in ie, in chrome, touch commands dont work on top of svg, , on firefox, mousewheel events problem. assume both on ie haha.
a decent solution somehow add event svg elements catches events , passes them onto scrolling events. can't seem find way. better solution somehow place document above svg svg doesn't interfere scrolling @ all. again, can't seem find way.
i embed svg elements object tags, important variety of reasons. i'm assuming object tag culprit.
per duopixel's comment. adding:
object { pointer-events: none; }
to css solve problem in both firefox , chrome. still have test in ie, seems best , easiest solution.
a article explains pointer events attribute can found @ http://davidwalsh.name/pointer-events
if issues mentioned above issue in ie, can use javascript solution requires capturing position of pointer , passing proper element. working version uses jquery translated vanilla javascript can found here: http://jsbin.com/uhuto/1/edit
Comments
Post a Comment