BN089-BS开发框架MVC4版/source20131023/Zephyr.Web/Content/css/metro/js/dialog.js
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/* Author: Valerio Battaglia (vabatta)
* Description: Function to create dialog box. You can have a dialog box open at once.
* Version: 1.0a
*
* Params:
* title - Title of the dialog box (HTML format)
* content - Content of the dialog box (HTML format)
* draggable - Set draggable to dialog box, available: true, false (default: false)
* overlay - Set the overlay of the page, available: true, false (default: true)
* closeButton - Enable or disable the close button, available: true, false (default: false)
* buttonsAlign - Align of the buttons, available: left, center, right (default: center)
* buttons - Set buttons in the action bar (JSON format)
* name - Text of the button (JSON format)
* action - Function to bind to the button
* position - Set the initial position of the dialog box (JSON format)
* zone - Zone of the dialog box, available: left, center, right (default: center)
* offsetY - Top offset pixels
* offsetX - Left offset pixels
*
* Goal for next versions:
* Add style param to set custom css to the dialog box controls
* Add possibility to resize window
*/
(function($) {
$.Dialog = function(params) {
if(!$.DialogOpened) {
$.DialogOpened = true;
} else {
return false;
}
params = $.extend({'position':{'zone':'center'},'overlay':true}, params);
var buttonsHTML = '<div';
// Buttons position
if(params.buttonsAlign)
{
buttonsHTML += ' style=" float: ' + params.buttonsAlign + ';">';
} else {
buttonsHTML += '>';
}
$.each(params.buttons, function(name,obj) {
// Generating the markup for the buttons
buttonsHTML += '<button>' + name + '</button>';
if(!obj.action)
{
obj.action = function() {};
}
});
buttonsHTML += '</div>';
var markup = [
// If overlay is true, set it
后面还有 93 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
