Web前端 easyui demo的这个demo在哪里找啊,就是点击编辑弹出一个对话框,代码和详解,谢谢

easyui iframe窗口处理
00:58 , 已有26407次阅读
关于嵌套的处理这个问题一直以来就有很多人问到最典型的就是在里面用的时候里面的弹不到最顶层只能覆盖到本身那么怎么样才能在里面自由穿透呢下面我就给大家贴一段代码.看完这下面这段代码,相信你会对这种问题要怎么处理有个初步的概念.
建立一个子页面.iframe页面
&!DOCTYPE html&
&meta charset=utf-8 /&
easyui iframe窗口
&script class="jsbin" src="/jquery-1.7.2.min.js"&
&p id="hello"&
Hello OSCTools
&button onclick="copen()"&
在子窗口定义
&button onclick="popen()"&
在父窗口定义
&div id="test" modal="true" title="定义在子窗口" style="width:300height:100"&
定义两个方法
function popen(){
var jq = top.jQ
top.myopen(jq("#test").clone(),function(){
jq("#test").text("这是定义在父窗口");
function copen(){
top.myopen($("#test").clone(),function(){
$("#test").text("这是定义在子窗口");jQuery UI 教程
jQuery UI 实例 - 对话框(Dialog)
在一个交互覆盖层中打开内容。
如需了解更多有关 dialog 部件的细节,请查看 API 文档 。
基本的对话框窗口是一个定位于视区中的覆盖层,同时通过一个 iframe 与页面内容分隔开(就像 select 元素)。它由一个标题栏和一个内容区域组成,且可以移动,调整尺寸,默认可通过 'x' 图标关闭。
&!doctype html&
&html lang="en"&
&meta charset="utf-8"&
&title&jQuery UI 对话框(Dialog) - 默认功能&/title&
&link rel="stylesheet" href="///ui/1.10.4/themes/smoothness/jquery-ui.css"&
&script src="///jquery-1.9.1.js"&&/script&
&script src="///ui/1.10.4/jquery-ui.js"&&/script&
&link rel="stylesheet" href="/resources/demos/style.css"&
$(function() {
$( "#dialog" ).dialog();
&div id="dialog" title="基本的对话框"&
&p&这是一个默认的对话框,用于显示信息。对话框窗口可以移动,调整尺寸,默认可通过 'x' 图标关闭。&/p&
可以通过为 show/hide 属性指定一个特效来动画显示对话框。您必须为想使用的特效引用独立的特效文件。
&!doctype html&
&html lang="en"&
&meta charset="utf-8"&
&title&jQuery UI 对话框(Dialog) - 动画&/title&
&link rel="stylesheet" href="///ui/1.10.4/themes/smoothness/jquery-ui.css"&
&script src="///jquery-1.9.1.js"&&/script&
&script src="///ui/1.10.4/jquery-ui.js"&&/script&
&link rel="stylesheet" href="/resources/demos/style.css"&
$(function() {
$( "#dialog" ).dialog({
autoOpen: false,
effect: "blind",
duration: 1000
effect: "explode",
duration: 1000
$( "#opener" ).click(function() {
$( "#dialog" ).dialog( "open" );
&div id="dialog" title="Basic dialog"&
&p&这是一个动画显示的对话框,用于显示信息。对话框窗口可以移动,调整尺寸,默认可通过 'x' 图标关闭。&/p&
&button id="opener"&打开对话框&/button&
基本的模态
模态对话框防止用户与对话框以外的页面其他部分进行交互,直到对话框关闭为止。
&!doctype html&
&html lang="en"&
&meta charset="utf-8"&
&title&jQuery UI 对话框(Dialog) - 基本的模态&/title&
&link rel="stylesheet" href="///ui/1.10.4/themes/smoothness/jquery-ui.css"&
&script src="///jquery-1.9.1.js"&&/script&
&script src="///ui/1.10.4/jquery-ui.js"&&/script&
&link rel="stylesheet" href="/resources/demos/style.css"&
$(function() {
$( "#dialog-modal" ).dialog({
height: 140,
modal: true
&div id="dialog-modal" title="基本的模态对话框"&
&p&添加模态覆盖屏幕,让对话框看起来更突出,因为它让页面上其他内容变暗。&/p&
&p&Sed vel diam id libero &a href="http://www.w3cschool.cc"&rutrum convallis&/a&. Donec aliquet leo vel magna. Phasellus rhoncus faucibus ante. Etiam bibendum, enim faucibus aliquet rhoncus, arcu felis ultricies neque, sit amet auctor elit eros a lectus.&/p&
确认一个动作可能是破坏性的也可能是有意义的。设置 modal 选项为 true,并通过 buttons 选项来指定主要的和次要的用户动作。
&!doctype html&
&html lang="en"&
&meta charset="utf-8"&
&title&jQuery UI 对话框(Dialog) - 模态确认&/title&
&link rel="stylesheet" href="///ui/1.10.4/themes/smoothness/jquery-ui.css"&
&script src="///jquery-1.9.1.js"&&/script&
&script src="///ui/1.10.4/jquery-ui.js"&&/script&
&link rel="stylesheet" href="/resources/demos/style.css"&
$(function() {
$( "#dialog-confirm" ).dialog({
resizable: false,
height:140,
modal: true,
buttons: {
"Delete all items": function() {
$( this ).dialog( "close" );
Cancel: function() {
$( this ).dialog( "close" );
&div id="dialog-confirm" title="清空回收站吗?"&
&p&&span class="ui-icon ui-icon-alert" style="float: margin:0 7px 20px 0;"&&/span&这些项目将被永久删除,并且无法恢复。您确定吗?&/p&
&p&Sed vel diam id libero &a href="http://www.w3cschool.cc"&rutrum convallis&/a&. Donec aliquet leo vel magna. Phasellus rhoncus faucibus ante. Etiam bibendum, enim faucibus aliquet rhoncus, arcu felis ultricies neque, sit amet auctor elit eros a lectus.&/p&
使用模态对话框来请求用户在一个多步骤过程中输入数据。在内容区域嵌入 form 标记,设置 modal 选项为 true,并通过 buttons 选项来指定主要的和次要的用户动作。
&!doctype html&
&html lang="en"&
&meta charset="utf-8"&
&title&jQuery UI 对话框(Dialog) - 模态表单&/title&
&link rel="stylesheet" href="///ui/1.10.4/themes/smoothness/jquery-ui.css"&
&script src="///jquery-1.9.1.js"&&/script&
&script src="///ui/1.10.4/jquery-ui.js"&&/script&
&link rel="stylesheet" href="/resources/demos/style.css"&
body { font-size: 62.5%; }
label, input { display: }
input.text { margin-bottom:12 width:95%; padding: .4 }
fieldset { padding:0; border:0; margin-top:25 }
h1 { font-size: 1.2 margin: .6em 0; }
div#users-contain { width: 350 margin: 20px 0; }
div#users-contain table { margin: 1em 0; border-collapse: width: 100%; }
div#users-contain table td, div#users-contain table th { border: 1px solid # padding: .6em 10 text-align: }
.ui-dialog .ui-state-error { padding: .3 }
.validateTips { border: 1 padding: 0.3 }
$(function() {
var name = $( "#name" ),
email = $( "#email" ),
password = $( "#password" ),
allFields = $( [] ).add( name ).add( email ).add( password ),
tips = $( ".validateTips" );
function updateTips( t ) {
.text( t )
.addClass( "ui-state-highlight" );
setTimeout(function() {
tips.removeClass( "ui-state-highlight", 1500 );
function checkLength( o, n, min, max ) {
if ( o.val().length & max || o.val().length & min ) {
o.addClass( "ui-state-error" );
updateTips( "" + n + " 的长度必须在 " +
min + " 和 " + max + " 之间。" );
function checkRegexp( o, regexp, n ) {
if ( !( regexp.test( o.val() ) ) ) {
o.addClass( "ui-state-error" );
updateTips( n );
$( "#dialog-form" ).dialog({
autoOpen: false,
height: 300,
width: 350,
modal: true,
buttons: {
"创建一个帐户": function() {
var bValid =
allFields.removeClass( "ui-state-error" );
bValid = bValid && checkLength( name, "username", 3, 16 );
bValid = bValid && checkLength( email, "email", 6, 80 );
bValid = bValid && checkLength( password, "password", 5, 16 );
bValid = bValid && checkRegexp( name, /^[a-z]([0-9a-z_])+$/i, "用户名必须由 a-z、0-9、下划线组成,且必须以字母开头。" );
// From jquery.validate.js (by joern), contributed by Scott Gonzalez: /email_address_validation/
bValid = bValid && checkRegexp( email, /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i, "eg. " );
bValid = bValid && checkRegexp( password, /^([0-9a-zA-Z])+$/, "密码字段只允许: a-z 0-9" );
if ( bValid ) {
$( "#users tbody" ).append( "&tr&" +
"&td&" + name.val() + "&/td&" +
"&td&" + email.val() + "&/td&" +
"&td&" + password.val() + "&/td&" +
"&/tr&" );
$( this ).dialog( "close" );
Cancel: function() {
$( this ).dialog( "close" );
close: function() {
allFields.val( "" ).removeClass( "ui-state-error" );
$( "#create-user" )
.click(function() {
$( "#dialog-form" ).dialog( "open" );
&div id="dialog-form" title="创建新用户"&
&p class="validateTips"&所有的表单字段都是必填的。&/p&
&fieldset&
&label for="name"&名字&/label&
&input type="text" name="name" id="name" class="text ui-widget-content ui-corner-all"&
&label for="email"&邮箱&/label&
&input type="text" name="email" id="email" value="" class="text ui-widget-content ui-corner-all"&
&label for="password"&密码&/label&
&input type="password" name="password" id="password" value="" class="text ui-widget-content ui-corner-all"&
&/fieldset&
&div id="users-contain" class="ui-widget"&
&h1&已有的用户:&/h1&
&table id="users" class="ui-widget ui-widget-content"&
&tr class="ui-widget-header "&
&th&名字&/th&
&th&邮箱&/th&
&th&密码&/th&
&td&John Doe&/td&
&td&john.&/td&
&td&johndoe1&/td&
&button id="create-user"&创建新用户&/button&
使用模态对话框来在下一步动作执行之前确认信息和动作。设置 modal 选项为 true,并通过 buttons 选项来指定主要的动作(Ok)。
&!doctype html&
&html lang="en"&
&meta charset="utf-8"&
&title&jQuery UI 对话框(Dialog) - 模态消息&/title&
&link rel="stylesheet" href="///ui/1.10.4/themes/smoothness/jquery-ui.css"&
&script src="///jquery-1.9.1.js"&&/script&
&script src="///ui/1.10.4/jquery-ui.js"&&/script&
&link rel="stylesheet" href="/resources/demos/style.css"&
$(function() {
$( "#dialog-message" ).dialog({
modal: true,
buttons: {
Ok: function() {
$( this ).dialog( "close" );
&div id="dialog-message" title="下载完成"&
&span class="ui-icon ui-icon-circle-check" style="float: margin:0 7px 50px 0;"&&/span&
您的文件已经成功下载到文件夹中。
当前使用存储空间的 &b&36%&/b&。
&p&Sed vel diam id libero &a href="http://www.w3cschool.cc"&rutrum convallis&/a&. Donec aliquet leo vel magna. Phasellus rhoncus faucibus ante. Etiam bibendum, enim faucibus aliquet rhoncus, arcu felis ultricies neque, sit amet auctor elit eros a lectus.&/p&
反馈内容(*必填)
截图标记颜色
联系方式(邮箱)
联系邮箱:
投稿页面:
记住登录状态
重复输入密码<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
您的访问请求被拒绝 403 Forbidden - ITeye技术社区
您的访问请求被拒绝
亲爱的会员,您的IP地址所在网段被ITeye拒绝服务,这可能是以下两种情况导致:
一、您所在的网段内有网络爬虫大量抓取ITeye网页,为保证其他人流畅的访问ITeye,该网段被ITeye拒绝
二、您通过某个代理服务器访问ITeye网站,该代理服务器被网络爬虫利用,大量抓取ITeye网页
请您点击按钮解除封锁&

我要回帖

更多关于 easyui 登录界面demo 的文章

 

随机推荐