在努力提高渐进式网络应用程序的性能的同时,我遇到了一个新功能Passive Event Listeners,我发现很难理解这个概念.
什么是Passive Event Listeners,什么是需要有它在我们的项目?
javascript google-chrome event-listener dom-events passive-event-listeners
我已经审查并测试了各种功能,以防止身体在div内部滚动,并结合了应该起作用的功能.
$('.scrollable').mouseenter(function() {
$('body').bind('mousewheel DOMMouseScroll', function() {
return false;
});
$(this).bind('mousewheel DOMMouseScroll', function() {
return true;
});
});
$('.scrollable').mouseleave(function() {
$('body').bind('mousewheel DOMMouseScroll', function() {
return true;
});
});
Run Code Online (Sandbox Code Playgroud)
这样做有什么想法或更好的方法吗?
在Windows 8中使用鼠标滚轮滚动时,固定的背景图像会像疯了一样反弹.这仅影响IE 10和IE 11.这position:fixed也会影响元素.在IE 10和11中有没有阻止它发生?
这是一个固定背景图像的示例: