zoukankan      html  css  js  c++  java
  • jquery实现点击弹出对话框

    HTML

    <div class="dialog" id="delallpartdialog">
    <div class="title">
    <img alt="点击可以关闭" src="/static/images/disk.png" width="30px" height="30px;">
    确认提示
    </div>
    <div class="content">
    <span>你真的要删除所有分区吗?</span>
    </div>
    <div class="bottom">
    <input type="button" value="确定" class="btnok">
    <input type="button" value="取消" class="btnnoOk">
    </div>
    </div>

    CSS

    .dialog{360px;border:1px #666 solid;position:absolute;display:none;z-index:101;}
    .dialog .title {background: #333;padding:10px; color: #fff; font-weight: bold; }
    .dialog .content {background: #fff;padding:25px;height: 60px;}
    .dialog .content img {float: left;}
    .dialog .content span {float: left;padding:10px;}
    .dialog .bottom {text-align: right;padding:10px 10px 10px 0px;background: #eee;}
    .dialog .btn {border: #666 1px solid;65px;}

    JQuery

    $(".delallpart").on("click",function () {
    $.ajax({
    url:"/osd/opt/delallpart",
    type: "POST",
    datatype:'json',
    data: {"action":"del_all","del_mount":"2"},
    beforeSend: function (xhr, settings) {
    xhr.setRequestHeader("X-CSRFToken", getCookie2('csrftoken'));
    },
    success: function (arg) {
    var div = $("#delallpartdialog");
    div.css("display", "block");
    div.css("left", 500).css("top", 500);
    }
    });
    });
    $(".dialog").on("click",".btnnoOk", function () {
    alert("not ok");
    $(this).parents(".dialog").css("display", "none");
    });

    $("#delallpartdialog").on("click",".btnok", function () {
    alert("ok!");
    });

  • 相关阅读:
    远程仓库
    本地仓库
    仓库
    坐标和依赖
    my24_mysql索引-使用篇
    my23_pxc其中一个节点重建记录
    1.1 Rust安装
    1.2 学习笔记之数据类型
    my22_mydumper 使用总结
    my21_myloader -o参数
  • 原文地址:https://www.cnblogs.com/yilizhongzi-yilisha/p/15576887.html
Copyright © 2011-2022 走看看