在 jQuery UI 模式对话框打开时禁用浏览器滚动 [英] disable browser scrolling while jQuery UI modal dialog is open

查看:26
本文介绍了在 jQuery UI 模式对话框打开时禁用浏览器滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 jQuery UI 模式对话框打开时禁用浏览器中的滚动(仅针对浏览器的滚动条).

is it possible to disable scrolling in browser (just for browser's scrollbars) while a jQuery UI modal dialog is open.

注意:我确实希望在对话框内启用滚动

Note: I do want scrolling to be enabled inside the dialog

推荐答案

您不能完全禁用滚动,但您可以使用鼠标滚轮和通常执行滚动的按钮停止滚动.

You can't disable scrolling completely, but you can stop scrolling with the mouse wheel and the buttons that typically perform scrolling.

看看这个答案以了解这是怎么回事完毕.您可以在 create event 上调用这些函数,并在 关闭.

Take a look at this answer to understand how that is done. You could call these functions on the create event and return everything to normal, on close.

这篇关于在 jQuery UI 模式对话框打开时禁用浏览器滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆