anvaka / VivaGraphJS

Graph drawing library for JavaScript
Other
3.73k stars 423 forks source link

Zoom In Zoom out feature #7

Open sherlholmes opened 11 years ago

sherlholmes commented 11 years ago

Zoom in zoom out feature using mouse wheel is not working on Internet explorer.

anvaka commented 11 years ago

Which version of IE? What kind of graphics are you using (SVG or CSS)?

sherlholmes commented 11 years ago

In IE9, I am Using SVG graphics. Is there any way to have simple slider for zooming?

taichatha commented 7 years ago

Has there been an update to this?

pbless commented 7 years ago

IE used to be special but like with many other things MS gave up on being special. So to make zooming with the mouswheel work in IE11 the updateScrollEvents function in vivagraph needs to be modified just a little bit. Basically remove the 'special' treatment for IE and use the 'mousewheel' event for all browsers.

REPLACE BOLD TEXT WITH 'mousewheel' or just get rid of the if/else statement all together. Hope this helps.

if (browserInfo.browser === 'webkit') { element.addEventListener('mousewheel', handleMouseWheel, false); // Chrome/Safari } else { element.addEventListener('DOMMouseScroll', handleMouseWheel, false); // Others }