禁用Bootstrap glyphicon

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

此div包含一个使用bootstrap glypicon打开弹出窗口的链接

<div class="panel-heading" id="divHeading">
                <div class="panel-title">
                    My Header
                    <a href="#" id="lnkPopup" data-toggle="modal" data-target="#bs-example-modal-lg">
                        <span class="glyphicon glyphicon-briefcase pull-right" id="spOpenWindow"></span>
                    </a>
                </div>
            </div>

初始页面加载应禁用该链接。

$(document).ready(function () {       
        $("#lnkPopup").off();
    });

但是不删除click属性,有什么想法吗?

jquery twitter-bootstrap-3
3个回答
0
投票

我以前从未见过off(),但是为什么不使用Disabled,然后单击检查它?像这样:


0
投票

我更喜欢使用CSS。


0
投票
$("#lnkPopup").click(function(e){
    e.preventDefault();
    return false;
});
© www.soinside.com 2019 - 2024. All rights reserved.