Notes on the dialog attribute in Jquery_jquery
$('#dialogDiv').dialog(
{
hide:true, //Click to close to hide. If you don’t add this, an error will occur if you click again after closing the pop-up window.
autoOpen:false,
height:380,
width:800,
modal:true, //Mask layer (pop-up will affect the page size)
title:'Bid Opener',
overlay: {opacity: 0.5, background: "black" ,overflow:'auto'} ,
buttons:{
'OK':function(){
// Processing method addUser();
},
'Cancel':function(){
// Close the current Dialog
$(this).dialog("close");
}
}
}
);
$('#addItems').click(function( ){
loadPage('buildOpeningGroupAddOpering.htm','#dialogDiv'); //dialog memory page
//$(window.parent.document).find("#projectSpaceContent .show").height( 600)//Adjust the current Iframe height
$('#dialogDiv').data('title.dialog', 'Add bidder').dialog('open'); //Modify the title
return false;
})
function loadPage(path,id) {
$.get(path, function(data) {
// data = data.replace(//ig,""); //Remove script tag
data = data.replace(/?link.*>/ig,""); //Remove link tag
data = data.replace(/?html.*>/ig,""); //Remove html tag
data = data.replace(/< /?body.*>/ig,""); //Remove body tag
data = data.replace(/?head.*>/ig,""); //Remove head tag
data = data.replace(/?!doctype.*>/ig,""); //Remove doctype tag
data = data.replace(/
$(id).empty().html(data);//Clear contentMain content and load html
});
}
//Add a close button to the popup layer
$('.ui-dialog-buttonpane').show().empty();
$('
Let’s look at the example first. In addition, if you want to drag and change the size of the dialog, you must add ui.draggble.js and ui.resizable.js
<script> <br>$("#dialog").dialog({autoOpen:false,buttons:{"OK":function(){$(this).dialog("close") ;}},closeOnEscape:true,hide:"slide",modal:true,title:"dialog"}).dialog("open"); <br></script>
< div id="dialog" title="Dialog Title">You are a pig!
1 Attribute
1.11 autoOpen, when this attribute is true, the dialog window will be automatically opened when the dialog is called. When the attribute is false, the window will be hidden at first, and the dialog window will not pop up until .dialog("open") is reached. Default: true.
1.12 Initialization example: Please note that $('.selector') is the class name of dialog. In this example, .selector=#dialoag will not be explained again.
$('.selector').dialog({ autoOpen: false });
1.13 After initialization, get and set this property example:
//Get
var autoOpen = $('. selector').dialog('option', 'autoOpen');
//Setup
$('.selector').dialog('option', 'autoOpen', false);
1.21 bgiframe defaults to false. When true, the bgiframe plugin will be used, to fix the issue in IE6 where select boxes show on top of other elements, regardless of zIndex. Requires including the bgiframe plugin. Future versions may not require a separate plugin.
Under IE6, let the gray screen at the back cover the selection.
1.22 Initialization example:
$('.selector').dialog({ bgiframe: true });
1.23 After initialization, get and set:
//Get
var bgiframe = $('.selector').dialog('option', 'bgiframe');
//Settings
$('.selector').dialog('option', 'bgiframe', true);
1.31 buttons Display a button, write the text of the button, and set the button click function. Default is {}, no button.
The buttons attribute is already used in the above example, please pay attention.
1.32 Initialization example:
$('.selector').dialog({ buttons: { "Ok": function() { $(this).dialog("close"); } } });
1.33 After initialization, get and set:
//Get
var buttons = $('.selector').dialog('option', 'buttons');
//Set
$('.selector').dialog('option', 'buttons', { "Ok": function() { $(this).dialog("close"); } });
1.41 When closeOnEscape is true, click the ESC key on the keyboard to close the dialog. The default is true;
1.42 Initialization example:
$('.selector').dialog({ closeOnEscape: false });
1.43 After initialization , get and set:
//Get
var closeOnEscape = $('.selector').dialog('option', 'closeOnEscape');
//Set
$('.selector ').dialog('option', 'closeOnEscape', false);
1.51 dialogClass type will be added to dialog, default is empty
1.52 Initialization example:
$('.selector' ).dialog({ dialogClass: 'alert' });
1.53 After initialization, get and set:
//Get
var dialogClass = $('.selector').dialog('option', 'dialogClass');
//Set
$('.selector').dialog('option', 'dialogClass', 'alert');
1.61 draggable, resizable: whether draggable You can use the title header to drag, the default is true, and you can drag; whether resizable can change the size of the dialog, the default is true, you can change the size.
1.62 Initialization example:
$('.selector').dialog({ draggable: false,resizable:false });
1.63 After initialization, get and set:
//Get
var draggable = $('.selector').dialog('option', 'draggable');
//Setup
$('.selector').dialog('option', 'draggable', false);
1.71 width, height, the width and height of the dialog, the default is auto, automatic.
1.72 Initialization example:
$('.selector').dialog({ height: 530,width:200 });
1.73 After initialization, get and set: please refer to 1.63
1.81 maxWidth, maxHeight, minWidth, minHeight, the maximum width, maximum height, minimum width, and minimum height that the dialog can change. The default value of maxWidth and maxHeight is false, which is unlimited. The default value of minWidth and minHeight is 150. Using these properties requires ui.resizable.js support.
1.82 Initialization example:
$('.selector').dialog({ maxHeight: 400,maxWidth:600,minHeight:300,minWidth:300 });
1.83 After initialization, get and set: Please refer to 1.63
1.91 hide, show, the effect when the dialog is closed and opened. The default is null and has no effect
1.92 Initialization example: used in the above example, please see it yourself.
1.93 After initialization, get and set: please refer to 1.63
1.101 modal, whether to use modal window. After the modal window is opened, other elements of the page will not be clickable until the modal window is closed. Defaults to false to not modal the window.
1.102 Initialization example: $('.selector').dialog({ modal: true });
1.103 After initialization, get and set: please refer to 1.63
1.111 title, the title of the dialog Text, empty by default.
1.112 Initialization example: see the top example. 1.113 After initialization, get and set: please refer to 1.63
1.121 position, the display position of the dialog: can be 'center', 'left', 'right', 'top', 'bottom', or The offsets of top and left can also be a string array such as ['right', 'top'].
1.122 Initialization example: $('.selector').dialog({ position: ['top','right'] }); 1.123 After initialization, get and set: please refer to 1.63
1.131 zIndex, the zindex value of dialog, the default value is 1000.
1.132 Initialization example: $('.selector').dialog({ zIndex: 3999 }); 1.133 After initialization, get and set: please refer to 1.63
1.141 The default value of stack is true. When the dialog gets focus, the dialog will be on top.
1.142 Initialization example: $('.selector').dialog({ stack: false }); 1.143 After initialization, get and set: please refer to 1.63
2 event
2.11 beforeclose type dialogbeforeclose , this event will be triggered when the dialog tries to close. If false is returned, the closing will be blocked.
2.12 Initialization example: $('.selector').dialog({
beforeclose: function(event, ui) { ... }
});
2.13 Use type to bind this event Example: $('.selector').bind('dialogbeforeclose', function(event, ui) {
...
});
2.21 close type: dialogclose, when the dialog is This event is triggered after closing.
2.22 Initialization example: $('.selector').dialog({
close: function(event, ui) { ... }
});
2.23 Use type to bind this event Example: $('.selector').bind('dialogclose', function(event, ui) {
...
});
2.3 open type: dialogopen, when the dialog is opened triggered when. (The space is limited, so I will omit what should be omitted. You can refer to the initialization example and use of type binding events.)
2.4 focus type: dialogfocus, triggered when the dialog gains focus.
2.5 dragStart Type: dragStart, triggered when dialog dragging starts.
2.6 drag type: drag, triggered when the dialog is dragged.
2.7 dragStop Type: dragStop, triggered when the dialog drag is completed.
2.8 resizeStart Type: resizeStart, triggered when the dialog starts to change the size of the form.
2.9 resize type: resize, triggered when the dialog is resized.
2.10 resizeStop Type: resizeStop, triggered when the size is changed.
3 methods
3.1 destroy, I like this, destroy the earth. . . Example: .dialog( 'destroy' )
3.2 disable, dialog is not available, example: .dialog('disable');
3.3 enable, dialog is available, for example, 3.2
3.4 close, open, Close and open the dialog
3.5 option, set and get the dialog properties, for example: .dialog('option', optionName, [value]), if there is no value, it will be obtained.
3.6 isOpen, returns true if the dialog is open, for example: .dialog('isOpen')
3.7 moveToTop, moves the dialog to the top, for example: .dialog( 'moveToTop' )

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Detailed explanation of jQuery reference method: Quick start guide jQuery is a popular JavaScript library that is widely used in website development. It simplifies JavaScript programming and provides developers with rich functions and features. This article will introduce jQuery's reference method in detail and provide specific code examples to help readers get started quickly. Introducing jQuery First, we need to introduce the jQuery library into the HTML file. It can be introduced through a CDN link or downloaded

How to remove the height attribute of an element with jQuery? In front-end development, we often encounter the need to manipulate the height attributes of elements. Sometimes, we may need to dynamically change the height of an element, and sometimes we need to remove the height attribute of an element. This article will introduce how to use jQuery to remove the height attribute of an element and provide specific code examples. Before using jQuery to operate the height attribute, we first need to understand the height attribute in CSS. The height attribute is used to set the height of an element

How to use PUT request method in jQuery? In jQuery, the method of sending a PUT request is similar to sending other types of requests, but you need to pay attention to some details and parameter settings. PUT requests are typically used to update resources, such as updating data in a database or updating files on the server. The following is a specific code example using the PUT request method in jQuery. First, make sure you include the jQuery library file, then you can send a PUT request via: $.ajax({u

jQuery is a fast, small, feature-rich JavaScript library widely used in front-end development. Since its release in 2006, jQuery has become one of the tools of choice for many developers, but in practical applications, it also has some advantages and disadvantages. This article will deeply analyze the advantages and disadvantages of jQuery and illustrate it with specific code examples. Advantages: 1. Concise syntax jQuery's syntax design is concise and clear, which can greatly improve the readability and writing efficiency of the code. for example,

Title: jQuery Tips: Quickly modify the text of all a tags on the page In web development, we often need to modify and operate elements on the page. When using jQuery, sometimes you need to modify the text content of all a tags in the page at once, which can save time and energy. The following will introduce how to use jQuery to quickly modify the text of all a tags on the page, and give specific code examples. First, we need to introduce the jQuery library file and ensure that the following code is introduced into the page: <

Title: Use jQuery to modify the text content of all a tags. jQuery is a popular JavaScript library that is widely used to handle DOM operations. In web development, we often encounter the need to modify the text content of the link tag (a tag) on the page. This article will explain how to use jQuery to achieve this goal, and provide specific code examples. First, we need to introduce the jQuery library into the page. Add the following code in the HTML file:

How to tell if a jQuery element has a specific attribute? When using jQuery to operate DOM elements, you often encounter situations where you need to determine whether an element has a specific attribute. In this case, we can easily implement this function with the help of the methods provided by jQuery. The following will introduce two commonly used methods to determine whether a jQuery element has specific attributes, and attach specific code examples. Method 1: Use the attr() method and typeof operator // to determine whether the element has a specific attribute

jQuery is a popular JavaScript library that is widely used to handle DOM manipulation and event handling in web pages. In jQuery, the eq() method is used to select elements at a specified index position. The specific usage and application scenarios are as follows. In jQuery, the eq() method selects the element at a specified index position. Index positions start counting from 0, i.e. the index of the first element is 0, the index of the second element is 1, and so on. The syntax of the eq() method is as follows: $("s
