侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

propbox 简单实现

2024-02-22 星期四 / 0 评论 / 0 点赞 / 25 阅读 / 7446 字

<link rel="stylesheet" href="jquery.popbox.css" /> <script src="jquery.min.js"></script> <script s

 <link rel="stylesheet" href="jquery.popbox.css" />    <script src="jquery.min.js"></script>    <script src="jquery.popbox.js"></script><!DOCTYPE html><html lang="zh-cn"><head>    <meta charset="UTF-8" />    <title>示例页面</title>    <link rel="stylesheet" href="jquery.popbox.css" />    <script src="jquery.min.js"></script>    <script src="jquery.popbox.js"></script>    <style>    .pb_custombtn:link, .pb_cancelbtn:link, .pb_custombtn:visited, .pb_cancelbtn:visited{        display: inline-block;        height: 36px;        margin: 0 15px;        padding: 0 24px;        color: #fff;        line-height: 36px;        font-weight: normal;        font-size: 14px;        border-radius: 5px;    }    .pb_custombtn:link, .pb_custombtn:visited{        background: #2C9445;    }    .pb_custombtn:hover{        background: #53A767;    }    .pb_custombtn:active{        background: #53A767;    }    </style></head><body>    <div class="tt">        <div>页面内容...</div><div>页面内容...</div><div>页面内容...</div><div>页面内容...</div><div>页面内容...</div><div>页面内容...</div><div>页面内容...</div><div>页面内容...</div><div>页面内容...</div><div>页面内容...</div><div>页面内容...</div><div>页面内容...</div><div>页面内容...</div><div>页面内容...</div><div>页面内容...</div><div>页面内容...</div><div>页面内容...</div><div>页面内容...</div><div>页面内容...</div><div>页面内容...</div><div>页面内容...</div><div>页面内容...</div>        </div>    <div><a href="#" onclick="openbox()">123</div><div><script>function openbox(){$.popbox({    width : '600px',     maxHeight : '400px',  //body区域的最大高度    title : '提示',  //标题    content : '<a href="#" onclick="openbox2()">234</div>',  //主体内容,支持HTML标签    //contentSelector : '.tt',    contentUrl : 'demo2.html',    foot : 'hahahahaah',  //底部内容    showMask : true,  //是否显示遮罩层    showCloseBtn : true,  //是否显示关闭按钮    btns : [        {            type : 'ok',            text : '确定',            click : 'openbox()'        },        {            type : 'cancel',            text : '取消',            click : 'openbox()'        },{            type : 'custom',            text : '自定义的按钮',            click : function(){            debugger;                openbox2();            }        }    ], //默认显示的按钮    draggable : true,  //是否可拖动    autoClose : 0, //是否自动关闭,否则设为0,是则设为大于0的数字,表示关闭时间,单位ms    blurClose : false,  //点击窗口外部是否关闭窗口    onOpen : '', //窗口加载完毕时的动作    onClose : '',  //窗口关闭前的动作,返回false可组织窗口关闭    onOk : function(){alert('确定');},  //点击ok按钮    onCancel : ''  //点击cancel按钮});}function openbox2(){$.popbox({    width : '600px',     maxHeight : '400px',  //body区域的最大高度    title : '提示',  //标题    content : 'hello <ul><li>11</li><li>22</li><li>223</li></ul>',  //主体内容,支持HTML标签    //contentSelector : '.tt',    contentUrl : 'demo2.html',    foot : 'hahahahaah',  //底部内容    showMask : true,  //是否显示遮罩层    showCloseBtn : true,  //是否显示关闭按钮    btns : [        {            type : 'ok',            text : '确定',            click : ''        },        {            type : 'cancel',            text : '取消',            click : ''        },{            type : 'custom',            text : '自定义的按钮',            click : function(){                alert('自定义');            }        }    ], //默认显示的按钮    draggable : true,  //是否可拖动    autoClose : 0, //是否自动关闭,否则设为0,是则设为大于0的数字,表示关闭时间,单位ms    blurClose : false,  //点击窗口外部是否关闭窗口    onOpen : '', //窗口加载完毕时的动作    onClose : '',  //窗口关闭前的动作,返回false可组织窗口关闭    onOk : function(){alert('确定');},  //点击ok按钮    onCancel : ''  //点击cancel按钮});}</script></body></html>

 

广告 广告

评论区