最新消息:

bootstrap modal如何传值进modal框

bootstrap 桔子的桔子 3719浏览 0评论

本文资料参考:https://segmentfault.com/q/1010000000526453

<a href="#myModal" role="button" data-toggle="modal" class="del" date-id="参数"><i class="icon-remove"></i></a>



<div class="modal small hide fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3 id="myModalLabel">删除提示</h3>
    </div>
    <div class="modal-body">
        <p class="error-text"><i class="icon-warning-sign modal-icon"></i>确定要删除此项?</p>
    </div>
    <div class="modal-footer">
        <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
        <button class="btn btn-danger" data-dismiss="modal" date-id="需要传值的地方">删除</button>
    </div>
</div>


<script type="text/javascript">
    $(document).ready(function(){
        $(".del").click(function(){
            var id = $(this).attr('date-id');
            $("#myModal .modal-footer .btn-danger").attr("date-id",id);
            $("#Modal").modal();
        });
    });
</script>

转载请注明:桔子的桔子 » bootstrap modal如何传值进modal框

与本文相关的文章

  • 暂无相关文章!

您必须 登录 才能发表评论!