1 Reply Latest reply on Oct 14, 2014 4:16 AM by Siva.

    How do I get animation to play on movement of scrollwheel? (regardless of whether the page actually scrolls)

    mavsman4457

      I've tried calling sym.play() in my scroll event but that doesn't do the trick. I don't want the page to scroll, I just want to play my animation whenever the user flicks the scrollwheel on the mouse. And preferably I would be able to do different actions depending on whether the scroll is up or down. Is this possible?

        • 1. Re: How do I get animation to play on movement of scrollwheel? (regardless of whether the page actually scrolls)
          Siva. Level 3

          You can get the DOM element on creationComplete and add event listener   

           

           

          Symbol.bindSymbolAction(compId, symbolName, "creationComplete", function(sym, e) {

                 

                   function MouseWheelHandler(e) {

                 

                   sym.play();

                 

                   }

                   var ele= sym.getSymbolElement()[0];

                 

                   if (ele.addEventListener) {

                    // IE9, Chrome, Safari, Opera

                    ele.addEventListener("mousewheel", MouseWheelHandler, false);

                    // Firefox

                    ele.addEventListener("DOMMouseScroll", MouseWheelHandler, false);

                   }

                   // IE 6/7/8

                   else ele.attachEvent("onmousewheel", MouseWheelHandler);

           

           

                });

                //Edge binding end