问题
页面结构如下
------------------------------------------
| outerWindow |
| |
| 口口口口口口口口口口口口口口口 |
| buttons |
| |
| ---------------------------------- |
| | innerWindow | |
| | | |
| | | |
| | | |
| | | |
| | | |
| ---------------------------------- |
| |
------------------------------------------如果点击outerWindow中的按钮(buttons):
- 一般说来, 会导致innerWindow的失焦, 且焦点转移到outerWindow中.
那么,
- 如何阻止焦点转移到outerWindow, 一直保持在innerWindow中?
解决
// $ === jQuery var $buttonWrap = $('#button-wrap'); $buttonWrap.on('mousedown', function (event) { event.preventDefault(); });
原理分析
(待续...)
阻止焦点转移
1363

被折叠的 条评论
为什么被折叠?



