Javascript (); }); $(document).on(`mouseenter`、`.order`、function()){ $(`.order`).css(`background`、`white`); $(this.css(`background`、`lightblue`); }); $(document).on(`mouseexit`、`.order`、function()){ $(this.css(`background`、`white`); }); $(文档).on(`click`,函数(e){ console.log(e.target.id); $(`orderSelect`).hide(); });
小提琴:可以使用,因为它会在窗口失去焦点时点火Javascript (); }); $(document).on(`mouseenter`、`.order`、function()){ $(`.order`).css(`background`、`white`); $(this.css(`background`、`lightblue`); }); $(document).on(`mouseexit`、`.order`、function()){ $(this.css(`background`、`white`); }); $(文档).on(`click`,函数(e){ console.log(e.target.id); $(`orderSelect`).hide(); });,javascript,html,jquery,select,click,Javascript,Html,Jquery,Select,Click,小提琴:可以使用,因为它会在窗口失去焦点时点火 $(window).on(`blur`, function(e) { $(`#orderSelect`).hide(); }); 天啊。当然成功了。谢谢。我还在div上放了一个tabindex和onblur,它复制了所有内容,使它像一个标准的select元素。 $(window).on(`blur`, function(e) { $(`#orderSelect`).hide();
$(window).on(`blur`, function(e) {
$(`#orderSelect`).hide();
});
天啊。当然成功了。谢谢。我还在div上放了一个tabindex和onblur,它复制了所有内容,使它像一个标准的select元素。
$(window).on(`blur`, function(e) {
$(`#orderSelect`).hide();
});