用jquery中插件dialog实现弹框效果实例代码
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了用jquery中插件dialog实现弹框效果实例代码,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3319字,纯文字阅读大概需要5分钟。
内容图文
![用jquery中插件dialog实现弹框效果实例代码](/upload/InfoBanner/zyjiaocheng/365/bd933180b85042fa9c8b0f6bf7e21c16.jpg)
代码如下:
<!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=utf-8" />
<title>弹框遮罩效果</title>
<style type="text/css">
#dialog_link {padding: .4em 1em .4em 20px;text-decoration: none;position: relative;}
#dialog_link span.ui-icon {margin: 0 5px 0 0;position: absolute;left: .2em;top: 50%;margin-top: -8px;}
</style>
<script type="text/javascript" language="javascript" src="jquery-1.7.1.min.js">
</script>
<script type="text/javascript" language="javascript" src="jquery-ui-1.8.18.custom.min.js">
</script>
<link rel="stylesheet" href="ui-lightness/jquery-ui-1.8.18.custom.css"/>
<script type="text/javascript" language="javascript">
$(function(){
$("#dialog").dialog({
autoOpen:false,
buttons:[{
text:"ok",
click:function(){
$("#dialog").dialog("close");
}
},
{
text:"cancal",
click:function(){
$("#dialog").dialog("close");
}
}
],
position:"top",//弹出位置
width:600, //窗口宽度
height:200,
drag:function(){
alert("你干拽我试试");
}
});
$("#dialog_link").click(function(){
$("#dialog").dialog("open");
});
})
</script>
</head>
<body>
<a href="#" id="dialog_link" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-newwin"></span>Open Dialog</a>
<!--对话框$("#dialog").dialog()他就是一个对话框,在页面中就会隐藏-->
<div id="dialog" title="Hi" style="display:none">
hello
</div>
</body>
</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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>弹框遮罩效果</title>
<style type="text/css">
#dialog_link {padding: .4em 1em .4em 20px;text-decoration: none;position: relative;}
#dialog_link span.ui-icon {margin: 0 5px 0 0;position: absolute;left: .2em;top: 50%;margin-top: -8px;}
</style>
<script type="text/javascript" language="javascript" src="jquery-1.7.1.min.js">
</script>
<script type="text/javascript" language="javascript" src="jquery-ui-1.8.18.custom.min.js">
</script>
<link rel="stylesheet" href="ui-lightness/jquery-ui-1.8.18.custom.css"/>
<script type="text/javascript" language="javascript">
$(function(){
$("#dialog").dialog({
autoOpen:false,
buttons:[{
text:"ok",
click:function(){
$("#dialog").dialog("close");
}
},
{
text:"cancal",
click:function(){
$("#dialog").dialog("close");
}
}
],
position:"top",//弹出位置
width:600, //窗口宽度
height:200,
drag:function(){
alert("你干拽我试试");
}
});
$("#dialog_link").click(function(){
$("#dialog").dialog("open");
});
})
</script>
</head>
<body>
<a href="#" id="dialog_link" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-newwin"></span>Open Dialog</a>
<!--对话框$("#dialog").dialog()他就是一个对话框,在页面中就会隐藏-->
<div id="dialog" title="Hi" style="display:none">
hello
</div>
</body>
</html>
内容总结
以上是互联网集市为您收集整理的用jquery中插件dialog实现弹框效果实例代码全部内容,希望文章能够帮你解决用jquery中插件dialog实现弹框效果实例代码所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。