小编Ata*_*bev的帖子

具有最大化、最小化、调整大小、响应 jquery ui js 和扩展对话框 js 的对话框

所以我想要一个对话框,在右上角有一个最大化、调整大小、最小化、像 windows os 这样的按钮,以及对话框中的响应和可拖动功能。我正在使用 jquery、jquery ui 和扩展对话框框架,但我无法获得我想要的功能。代码也最大化了中心的对话框,但我想要全屏最大化。我仍然是 jquery 和 jquery ui 的初学者,所以我无法真正在这个框架上编码。

	$('#window').dialog({
    draggable: true,
   
    autoOpen: true,
    dialogClass: "test",
    modal: true,
    responsive: true,
    buttons: [
    {
        text: "minimize",
        click: function() {
            $(this).parents('.ui-dialog').animate({
                height: '40px',
                top: $(window).height() - 50
            }, 200);            
        }
    }]
   
    
});

$('#open').click(function() {
   $('#window').parents('.ui-dialog').animate({
       //set the positioning to center the dialog - 200 is equal to height of dialog
       top: ($(window).height()-200)/2,
       //set the height again
       height: 200
            }, 200); 
});

	
Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<html>
<meta charset="utf-8">
<title>AXB OS</title>
 <link …
Run Code Online (Sandbox Code Playgroud)

html javascript jquery jquery-ui

2
推荐指数
1
解决办法
2785
查看次数

标签 统计

html ×1

javascript ×1

jquery ×1

jquery-ui ×1