【问题标题】:Click even not working on <Label> [ Using EasyUI ]点击甚至不工作 <Label> [ 使用 EasyUI ]
【发布时间】:2017-12-25 08:34:04
【问题描述】:

在我的项目中,我使用的是 EasyUI。 我有两个标签“AA”和“BB”,当我将鼠标悬停在它上面时,它们的颜色会发生变化。现在,我想在点击标签时做一些事情。但是点击事件不起作用。

这是我的代码:

<script>
    function recDoc(){
    alert("xietst");
    }
</script>
<body style="height:100%">
    <style>
        .dlgLabel{cursor:pointer}
        .dlgLabel:hover {background-color:blue;color:white}
    </style>
    <div  id="dlg" class="easyui-dialog"  title="" 
style="width:88px;height:260px;top:130px;left:170px;padding:10px">
        <label class="dlgLabel" onclick="recDoc()">AA</label><br />
        <label class="dlgLabel">BB</label><br />
    </div>
</body>

当我删除 class=easyui-dialog 时,它可以工作。

但我希望即使在使用 easyui 时标签也可以点击。任何帮助都会很棒。

【问题讨论】:

  • 点击 AA 标签时,您的 onclick 正常工作。 BB 标签缺少 onclick 事件,因此单击时不起作用
  • 我测试过点击AA标签不起作用
  • 您是否阻止该页面打开其他对话框?换个浏览器试试
  • 我测试过 firfox、chrome 和 IE,它们都运行失败

标签: javascript jquery html css jquery-easyui


【解决方案1】:

您应该按照文档中的示例进行操作:

http://www.jeasyui.com/demo/main/index.php?plugin=Dialog

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多