Jquery互动对话框是怎么实现的

林少1024 2012-07-25 09:55:18

类似这种弹出的对话框,登录后跳转,对话框返回值等。是怎么实现 的
是采用哪种插件呢。
...全文
147 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
色拉油 2012-07-26
  • 打赏
  • 举报
回复
自己用个绝对定位的DIV就能实现
davidcoffee 2012-07-25
  • 打赏
  • 举报
回复
下载地址http://jqueryui.com/里面不只有你要的dialog还有其他tab啦,折叠啦,自动联想各种强大啊...希望对你有帮助啦~当然如2L所说要锻炼下也可以自己写个这样的他这种dialog无非就是个div,你写点JS和样式让他看起来是浮层效果就行了~
davidcoffee 2012-07-25
  • 打赏
  • 举报
回复
用jquery ui中的dialog他已经封装的很强大了,看下api大多数功能都有的
你要的大概就是如下效果吧

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<input type="button" id="testDialog" name="testDialog" onclick="javascript:$('#dialog').dialog('open');"
value="测试Dialog" />
<div id="dialog" title="Dialog Title">
<table style="width: 90%;">
<tr>
<th colspan="2">
<strong>基本信息</strong>
</th>
</tr>
<tr>
<td style="width: 30%;">
<strong>登陆账号:</strong>
</td>
<td style="width: 70%;">
<input id="account" name="account" value="" />
</td>
</tr>
<tr>
<td style="width: 30%;">
<strong>密码:</strong>
</td>
<td style="width: 70%;">
<input id="password" name="password" value="" />
</td>
</tr>
</table>
<%-- <input type="text" name="modifyValue" id="modifyValue" value="" />--%>
</div>
<script language="javascript" type="text/javascript">

var InitDialog = function () {
$('#dialog').dialog({
autoOpen: false,
width: 600,
title: "用户登陆",
buttons: {
"Ok": function () {
//触发你的jquery form验证通过进行下一步,关闭dialog
$(this).dialog("close");
},
"Cancel": function () {
$(this).dialog("close");
}
}
});
}
//创建dialog对象表示初始化,等同于在$().ready(function(){})里调用
var initDialog = new InitDialog();
</script>
</asp:Content>

全栈极简 2012-07-25
  • 打赏
  • 举报
回复
这个完全可以自己写,当然也有各种现成的,不过可定制化不高。帮顶吧,说来话长。。
最新官方jQuery UI插件 主流特效Demo,绝不含糊。 好东西不需要过多的言辞修饰,下了就知道! 所有效果说明: 基本的鼠标互动: 拖拽(drag and dropping)、排序(sorting)、选择(selecting)、缩放(resizing) 各种互动效果: 手风琴式的折叠菜单(accordions)、日历(date pickers)、对话框(dialogs)、滑动条 (sliders)、表格排序(table sorters)、页签(tabs) 放大镜效果(magnifier)、阴影效果(shadow) 第一部分:鼠标交互 1.1 Draggables:拖拽 所需文件: ui.mouse.js ui.draggable.js ui.draggable.ext.js 用法:文件载入后,可以拖拽class = "block"的层 $(document).ready(function(){ $(".block").draggable(); }); draggable(options)可以跟很多选项 选项说明:http://docs.jquery.com/UI/Draggables/draggable#options 选项实例:http://dev.jquery.com/view/trunk/plugins/ui/tests/draggable.html 1.2 Droppables 所需要文件,drag drop ui.mouse.js ui.draggable.js ui.draggable.ext.js ui.droppable.js ui.droppable.ext.js 用法: $(document).ready(function(){ $(".block").draggable({helper: 'clone'}); $(".drop").droppable({ accept: ".block", activeClass: 'droppable-active', hoverClass: 'droppable-hover', drop: function(ev, ui) { $(this).append("Dropped!"); } }); }); 选项说明:http://docs.jquery.com/UI/Droppables/droppable#options 选项实例:http://dev.jquery.com/view/trunk/plugins/ui/tests/droppable.html 1.3 Sortables 排序 所需要的文件 jquery.dimensions.js ui.mouse.js ui.draggable.js ui.droppable.js ui.sortable.js 用法: $(document).ready(function(){ $("#myList").sortable({}); }); dimensions文档http://jquery.com/plugins/project/dimensions 选项说明:http://docs.jquery.com/UI/Sortables/sortable#options 选项实例:http://dev.jquery.com/view/trunk/plugins/ui/demos/ui.sortable.html 1.4 Selectables 选择 所需要的文件 jquery.dimensions.js ui.mouse.js ui.draggable.js ui.droppable.js ui.selectable.js 用法: $(document).ready(function(){ $("#myList").selectable(); }); 选项说明:http://docs.jquery.com/UI/Selectables/selectable#options 选项实例:http://dev.jquery.com/view/trunk/plugins/ui/tests/selectable.html 1.5 Resizables改变大小 所需要的文件 ,此例子需要几个css文件 jquery.dimensions.js ui.mouse.js ui.resizable.js 用法: $(document).ready(function(){ $("#example").resizable(); }); CSS文件:http://dev.jquery.com/view/trunk/themes/flora/flora.all.css 选项说明:http://docs.jquery.com/UI/Resizables/resizable#options 选项实例:http://dev.jquery.com/view/trunk/plugins/ui/demos/ui.resizable.html 第二部分:互动效果 2.1 Accordion 折叠菜单 所需要的文件: ui.accordion.js jquery.dimensions.js 用法: $(document).ready(function(){ $("#example").accordion(); }); CSS文件:http://dev.jquery.com/view/trunk/themes/flora/flora.all.css 选项说明:http://docs.jquery.com/UI/Accordion/accordion#options 选项实例:http://dev.jquery.com/view/trunk/plugins/accordion/?p=1.1.1 2.2 dialogs 对话框 所需要的文件: jquery.dimensions.js ui.dialog.js ui.resizable.js ui.mouse.js ui.draggable.js 用法: $(document).ready(function(){ $("#example").dialog(); }); CSS文件:http://dev.jquery.com/view/trunk/themes/flora/flora.all.css 选项说明:http://docs.jquery.com/UI/Dialog/dialog#options 选项实例:http://dev.jquery.com/view/trunk/plugins/ui/tests/dialog.html 2.3 sliders 滑动条 所需要的文件 jquery.dimensions.js ui.mouse.js ui.slider.js 用法: $(document).ready(function(){ $("#example").slider(); }); CSS文件:http://dev.jquery.com/view/trunk/themes/flora/flora.all.css 选项说明:http://docs.jquery.com/UI/Slider/slider#options 选项实例:http://dev.jquery.com/view/trunk/plugins/ui/demos/ui.slider.html 2.4 Tablesorter表格排序 所需要的文件 ui.tablesorter.js 用法: $(document).ready(function(){ $("#example").tablesorter({sortList:[[0,0],[2,1]], widgets: ['zebra']}); }); CSS文件:http://dev.jquery.com/view/trunk/themes/flora/flora.all.css 选项说明:http://docs.jquery.com/Plugins/Tablesorter/tablesorter#options 选项实例:http://tablesorter.com/docs/#Demo 2.5 tabs页签(对IE支持不是很好) 所需要的文件 ui.tabs.js 用法: $(document).ready(function(){ $("#example > ul").tabs(); }); CSS文件:http://dev.jquery.com/view/trunk/themes/flora/flora.all.css 选项说明:http://docs.jquery.com/UI/Tabs/tabs#initialoptions 选项实例:http://dev.jquery.com/view/trunk/plugins/ui/tests/tabs.html tabs ext http://stilbuero.de/jquery/tabs_3/rotate.html 第三部分:效果 3.1 Shadow 阴影 实例http://dev.jquery.com/view/trunk/plugins/ui/demos/ui.shadow.html 3.2 Magnifier 放大 实例http://dev.jquery.com/view/trunk/plugins/ui/demos/ui.magnifier.html

62,047

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧