jquery的SimpleModal插件的使用

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script src="../jquery.min.js"></script>
<script src="../jquery.simplemodal-1.4.4.js"></script>
<script>
$(function(){
$("#btn").click(function(){
$("#mydiv").modal();
})
}
);
</script>

<style>
#mydiv{
  display:none;
}
#simplemodal-overlay {background-color:#000;}
#simplemodal-container {height:200px; width:600px; color:#bbb; background-color:#333; border:4px solid #444; padding:12px;}
#simplemodal-container a.modalCloseImg {background:url(simplemodal-demo/simplemodal-demo-basic-1.4.4/basic/img/basic/x.png) no-repeat; width:25px; height:29px; display:inline; z-index:3200; position:absolute; top:-15px; right:-16px; cursor:pointer;}
.STYLE1 {
	font-size: larger;
	font-weight: bold;
}
</style>
</head>
<body>
<button id="btn">执行</button>
<div id="mydiv">
 <h1>提示</h1>
 <div>这是模态窗口提示的内容!</div>
 <div align="right"><a class="simplemodal-close STYLE1">关闭</a> </div>
</div>
</body>
</html>


完整的HTML:


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head> … </head>
        <body>
            <button id="btn">

                执行

            </button>
            <span id="simplemodal-placeholder" style="display: none;"></span>
            <div id="simplemodal-overlay" class="simplemodal-overlay" style="opacity: 0.5; height: 171px; width: 1366px; position: fixed; left: 0px; top: 0px; z-index: 1001;"></div>
            <div id="simplemodal-container" class="simplemodal-container" style="position: fixed; z-index: 1002; height: 200px; width: 600px; left: 367px; top: -30.5px;">
                <a class="modalCloseImg simplemodal-close" title="Close"></a>
                <div class="simplemodal-wrap" tabindex="-1" style="height: 100%; outline: 0px none; width: 100%; overflow: visible;">
                    <div id="mydiv" class="simplemodal-data" style="display: block;">
                        <h1> … </h1>
                        <div> … </div>
                        <div align="right"> … </div>
                    </div>
                </div>
            </div>
        </body>
    </html>


 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值