Custom mousewheel event in Chrome
HTML
<div id="foo"> foo </div>
CSS
#foo{
height:200px;
width: 200px;
background-color:red;
}
JavaScript
Y.use('node', function(){
function simulateWheelEvent(target) /*:Void*/
{
view = Y.config.win;
$("div").hide();
eventInst = document.createEvent("MouseEvents");
eventInst.initMouseEvent('mousewheel', true, true);
eventInst.wheelDelta = -1;
view.dispatchEvent(eventInst);
}
Y.one("#foo").on('mousewheel', function(e){
console.log('mousewheel');
console.log(e);
});
simulateWheelEvent(Y.one('#foo'));
});