Is there a way to trigger a scroll wheel event with an arbitrary delta. Just like jQuery does with \'click\' like:
$(\'#selector\').trigger(\'click\');
You can use the jquery scroll event and on call back u can do ur math. Please find the code snipet usefull.
//to make dummy paragraphs
$( "p" ).clone().appendTo( document.body );
$( "p" ).clone().appendTo( document.body );
$( "p" ).clone().appendTo( document.body );
$( "p" ).clone().appendTo( document.body );
$( "p" ).clone().appendTo( document.body );
$( "p" ).clone().appendTo( document.body );
//dummy paragraphs end here
//the below scroll() callback is triggered eachtime mouse wheel scroll happens
$( window ).scroll(function() { //i reference to window if u want u can iD a div and give div ID reference as well
console.log("scolling....");
//update with the delta u required.
});
scroll demo
Try scrolling the iframe.
Paragraph - Scroll happened!