如何在激活灯箱插件时禁用鼠标滚轮的背景滚动
How to disable background scrolling with mouse wheel while a lightbox plugin is activated?
我正在开发一个水平滚动网站。在它上面,我正在使用鼠标滚轮.js插件(允许使用鼠标滚轮水平滚动)和 magnific 弹出窗口插件。
当有人通过单击照片激活 magnific 弹出窗口插件时,它会打开照片,因为它应该如此,并且背景滚动条被禁用。
但是,由于我使用的是鼠标滚轮.js,背景仍然可以使用鼠标滚轮滚动。
如何仅在 magnific 弹出窗口显示照片时才禁用背景滚动?
我也有类似的问题。这个决定在一定程度上帮助了我。
$('#open_button').magnificPopup({
type: 'inline', // Custom settings, never mind
closeBtnInside: false, // Custom settings, never mind
fixedContentPos: false, // Custom settings, never mind
fixedBgPos: true, // Custom settings, never mind
callbacks: {
open: function() { // When you open the
$('body').css('overflow', 'hidden'); // window, the element
}, // "body" is used "overflow: hidden".
close: function() { // When the window
$('body').css('overflow', ''); // is closed, the
}, // "overflow" gets the initial value.
}
});
fixedContentPos: true,
overflowY: 'hidden',
这应该有效!
相关文章:
- fullpage.js和物化.js;使用实体侧导航禁用鼠标滚动
- 如何使用鼠标滚动控制fullPage.js垂直滑块
- 网站跟随鼠标滚动
- JQuery 自动滚动到底部(但在鼠标滚动时禁用)
- 我想要一个类似于网站 https://onlycoin.com/ 的jQuery鼠标滚动动画效果
- 如何检查表单提交时鼠标滚动点击完成的点击事件
- 在鼠标滚动上将页面内容滚动到自定义位置
- jQuery鼠标滚动到下一个id
- 如何通过鼠标滚动按钮左右滚动
- 实现滚动条,但光标根本没有移动?另外,如果可以的话,请告诉我如何在此嵌入鼠标滚动
- 在鼠标滚动时使用 JQuery 水平滚动元素
- 用鼠标滚动到块的高度
- 使用鼠标滚动 kineticjs 旋转矩形
- 使用按钮和鼠标滚动 DIV
- 如何仅在整页中禁用鼠标滚动触发器.js
- 如何在必应地图 v7 中禁用鼠标滚动标记
- 鼠标滚动左在IE,火狐,野生动物园上不起作用
- 在 d3.js 中使用滑块和鼠标滚动进行缩放
- Sencha触摸表单面板,不使用鼠标滚动
- AngularJS服务器侧鼠标滚动分页