【问题标题】:Jquery Show div on Clicking scrollbarJquery在单击滚动条上显示div
【发布时间】:2014-06-16 23:00:23
【问题描述】:

如果我单击页面上的任何位置而不是 div 内部,我会尝试隐藏 div。但是,如果我单击该 div 的滚动条,我将无法停止 div 隐藏。可能是什么问题?

Here is my fiddle

期望:如果我移动滚动条,不要隐藏 div。(在 Internet Explorer 中)

    var $container = $(".toolbarContent");

//Hide red div if we click out side of the red div
$(document).mouseup(function (e) {
        if (!$container.is(e.target) // if the target of the click isn't the container...
            && $container.has(e.target).length === 0) // ... nor a descendant of the container
        {
            $container.hide("slow");
        }
    });

$('#showDiv').click(function () {
$container.show();
});

【问题讨论】:

  • 什么是浏览器?,我在谷歌浏览器中测试过,div在我点击滚动条时没有隐藏。
  • 我正在尝试使用 IE,因为它是我公司首选的强制浏览器。

标签: jquery html css show-hide


【解决方案1】:

我在 Chrome 和 Firefox 中测试过你的例子,没有问题,但是你使用的是 IE 8 不支持的 jQuery 2.0,可能是这个问题的原因 here is the browser support details for jQuery 2.0

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-16
    • 2010-10-24
    • 1970-01-01
    • 2016-07-16
    相关资源
    最近更新 更多