点击事件无效[使用EasyUI]

问题描述 投票:0回答:1

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

这是我的代码:

<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,我也希望标签可以点击。任何帮助都会很棒。

javascript jquery html css jquery-easyui
1个回答
0
投票

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

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

© www.soinside.com 2019 - 2024. All rights reserved.