手机版 | ------------全站资源有,统一解压码,解码平台,请点这里 ------------ 设首页 | 加收藏
当前位置: 网站首页 > jQuery库 > 文章 当前位置: jQ > 文章

jQuery弹出层窗口插件popupWindow.js

时间:2020-06-25    点击: 次    来源:网络    作者:佚名 - 小 + 大

jQuery弹出层窗口插件popupWindow.js
简要教程

popupWindow.js是一款jQuery弹出层窗口插件。该插件能够轻松的制作弹出层模态窗口效果。弹出的窗口支持最大化、最小化、拖拽、改变尺寸等功能。

使用方法

安装:

 npm install gasparesganga-jquery-popup-windowbower install gasparesganga-jquery-popup-window                                  

在HTML文件中引入。

  <link href="src/popupwindow.css" rel="stylesheet"><script src="//code.jquery.com/jquery.min.js"></script><script src="src/popupwindow.js"></script>                   
HTML结构
<button id="basic-demo_button" class="btn btn-primary">单窗口示例</button><div id="basic-demo" class="example_content">这是一个模态窗口</div>                
CSS样式

初始化时隐藏窗口内容。

.example_content {  display : none;}                 
初始化插件

然后通过下面的代码来初始化插件。

$("#basic-demo").PopupWindow({  // options here});                          

配置参数

$("#basic-demo").PopupWindow({  // popup title  title               : "Popup Window",  // modal mode  modal               : true,  // auto open on page load  autoOpen            : true,  // anmation speed  animationTime       : 300,  // custom css classes  customClass         : "",    // custom action buttons  buttons             : {      close               : true,      maximize            : true,      collapse            : true,      minimize            : true  },  // button's position  buttonsPosition     : "right",  // custom button text  buttonsTexts        : {    close               : "Close",    maximize            : "Maximize",    unmaximize          : "Restore",    minimize            : "Minimize",    unminimize          : "Show",    collapse            : "Collapse",    uncollapse          : "Expand"  },     // draggable options  draggable           : true,  nativeDrag          : true,  dragOpacity         : 0.6,    // resizable options  resizable           : true,  resizeOpacity       : 0.6,    // enable status bar  statusBar           : true,    // top position  top                 : "auto",  // left position  left                : "auto",    // height / width  height              : 200,  width               : 400,  maxHeight           : undefined,  maxWidth            : undefined,  minHeight           : 100,  minWidth            : 200,  collapsedWidth      : undefined,    // always keep in viewport  keepInViewport      : true,  // enable mouseh move events  mouseMoveEvents     : true  });                

API

// open$('#selector').PopupWindow("open")// close$('#selector').PopupWindow("close")// maximize$('#selector').PopupWindow("maximize")// unmaximize$('#selector').PopupWindow("unmaximize")// minimize$('#selector').PopupWindow("minimize")// unminimize$('#selector').PopupWindow("unminimize")// collapse$('#selector').PopupWindow("collapse")// uncollapse$('#selector').PopupWindow("uncollapse")// get the current position of the firset popup window// return an object with numeric top and left values.$('#selector').PopupWindow("getposition")// set the poisition$('#selector').PopupWindow("setposition", position)// get the current size of the firset popup window// return an object with numeric width and height values.$('#selector').PopupWindow("getsize")// set the size$('#selector').PopupWindow("setsize", size)// get the current state  of the firset popup window// return a string representing the state: normal, closed, collapsed, minimized or maximized$('#selector').PopupWindow("getstate")// set the state$('#selector').PopupWindow("setstate", state)// set the title$('#selector').PopupWindow("settitle", title)// set the content in the status bar$('#selector').PopupWindow("statusbar", content)// destroy the plugin$('#selector').PopupWindow("destroy")                                    

 popupWindow.js-jQuery弹出层窗口插件的github网址为:https://github.com/gasparesganga/jquery-popup-window

 jQuery弹出层窗口插件popupWindow.js 本地下载

上一篇:支持animate.css动画的jquery弹出层插件

下一篇:js艺术二维码生成插件

浙ICP备18035339号-15  |   QQ:79720816  |  地址:蚂蚁分享-一个只做有用的分享。  |  13388629007  |  
Copyright © 2023 蚂蚁分享网 版权所有,授权www.tanan.net使用 Powered by ANTQQ.COM