jQuery(function($) { //SCROLL DISABLE WR.ui.add( scroll_disable_init, true ); WR.ui.add( scroll_disable_destroy, true ); /* **************************************** * * ON LOAD * **************************************** */ $(window).on('load',function() { // add here }); function init_resize(){ // add here WR.ui.add( media_element_player, true ); } // Init resize on reisize $(window).on('resize',init_resize); // window scroll event on/off function scroll_disable_init(){ WR.smoothscroll.destroy(); if(scrolling_passive()){ window.addEventListener("wheel",destroy_scrolling,{passive: false}); }else{ $(window).on("mousewheel DOMMouseScroll", destroy_scrolling); } } function scroll_disable_destroy(){ if( !$('html').hasClass('ie') ) { WR.smoothscroll.init(); } if(scrolling_passive()){ window.removeEventListener("wheel", destroy_scrolling); }else{ $(window).off("mousewheel DOMMouseScroll", destroy_scrolling); } } // scroll passive mode check function scrolling_passive(){ var supportsPassive = false; try { document.addEventListener("test", null, { get passive() { supportsPassive = true }}); } catch(e) {} return supportsPassive; } // disabled scroll function destroy_scrolling(event){ event.preventDefault(); } }); // End jQuery