jquery - 当身体变暗时,使切换开关出现在身体上方

时间:2014-06-19 20:03:25

标签: jquery button toggle

我正在使用此脚本https://github.com/andywer/jquery-dim-background在切换开关上调暗我的页面。但是,当页面变暗时,我将失去切换开关的能力。我的代码如下。您还可以在此处查看http://www.fospower.com/test

任何帮助都非常感谢。

$(function() {
    $('input#lightswitch').iToggle({
        easing: 'easeOutExpo',
        onClickOn:function() {
            //$('input:checkbox').addClass('iT_checkbox_on');
            $('input:radio').addClass('iT_checkbox_on');
            $(this).dimBackground({
                darkness:0.8
            }, function() {

            });
        },
        onClickOff:function() {
            //$('input:checkbox').removeClass('iT_checkbox_on');
            $('input:radio').removeClass('iT_checkbox_on');
            $(this).undim();
        }
    });
}); 

2 个答案:

答案 0 :(得分:0)

看起来jquery脚本生成的幕布层的z-index将其置于其他元素之上,如切换开关。尝试在功能中调整切换开关的z-index,以便在"帘幕时将开关移到顶部。应用,并在"窗帘"被删除了。

答案 1 :(得分:0)

如果您只是将pointer-events:none;添加到.dimbackground-curtain的内联css,您就可以点击该开关。