winbox

winbox

轻量级HTML5网页窗口管理工具

WinBox.js是一个开源的HTML5窗口管理工具,体积小巧且性能优异。它提供拖拽、缩放、最小化等常用功能,便于开发交互性网页应用。该项目不依赖其他库,可定制性强,能够适应不同的窗口管理场景,满足多样化的网页窗口管理需求。

WinBox.js窗口管理器HTML5JavaScript前端开发Github开源项目
<h1> <img src="https://cdn.jsdelivr.net/gh/nextapps-de/winbox@master/demo/winbox-gradient.svg" alt="WinBox.js: A modern HTML5 window manager for the web." width="100%"> </h1> <h3>Modern window manager for the web: lightweight, outstanding performance, no dependencies, fully customizable, open source!</h3>

<a target="_blank" href="https://www.npmjs.com/package/winbox"><img src="https://img.shields.io/npm/v/winbox.svg"></a><!--<a target="_blank" href="https://github.com/nextapps-de/winbox/issues"><img src="https://img.shields.io/github/issues/nextapps-de/winbox.svg"></a>--> <a target="_blank" href="https://github.com/nextapps-de/winbox/blob/master/LICENSE.md"><img src="https://img.shields.io/npm/l/winbox.svg"></a>

<a href="https://nextapps-de.github.io/winbox/">Demo</a>  •  <a href="#started">Getting Started</a>  •  <a href="#options">Options</a>  •  <a href="#api">API</a>  •  <a href="#themes">Themes</a>  •  <a href="#customize">Customize</a>  •  <a href="CHANGELOG.md">Changelog</a>

<a name="demo"></a>

Live Demo and Code Examples

<a href="https://nextapps-de.github.io/winbox/">https://nextapps-de.github.io/winbox/ </a>

Support this Project

Hello my name is Thomas, also known as ts-thomas. This is a personal project which I fully made in my free time. It is hosted by the Github account from the company Nextapps where I work to give it more exposure. I have never received any financial support for this project from the company Nextapps as some of you might have guessed, since it is a free and open source project. I'm really happy that WinBox.js is getting so much positive feedback and also feature requests. Please feel free to support me by making a personal donation which helps me a lot to keep this project alive and also to providing all the contribution to keep WinBox.js on a professional top-end level.

<a href="https://opencollective.com/winboxjs/donate" target="_blank" style="margin-right: 10px"> <img src="https://opencollective.com/webpack/donate/button@2x.png?color=blue" height="32" alt="Donate using Open Collective"> </a> <a href="https://github.com/sponsors/ts-thomas/" target="_blank" style="margin-right: 10px"> <img src="https://camo.githubusercontent.com/b932f45963b659dfeb86b77ff29a9eaebe25a734d63a17a176aa82bf34845cf2/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d53706f6e736f72266d6573736167653d254532253944254134266c6f676f3d47697448756226636f6c6f723d253233666538653836" height="32" alt="Donate using Github Sponsors"> </a> <a href="https://liberapay.com/ts-thomas/donate" target="_blank" style="margin-right: 10px"> <img src="https://liberapay.com/assets/widgets/donate.svg" height="32" alt="Donate using Liberapay"> </a> <a href="https://www.patreon.com/user?u=96245532" target="_blank" style="margin-right: 10px"> <img src="https://s3-us-west-1.amazonaws.com/widget-images/become-patron-widget-medium%402x.png" height="32" alt="Donate using Patreon"> </a> <a href="https://salt.bountysource.com/teams/ts-thomas" target="_blank" style="margin-right: 10px"> <img src="https://d2bbtvgnhux6eq.cloudfront.net/assets/logos/alternate-7868987b01474c95f47678727f6657882f6565a36396eb4b637ea53cc5944ff8.svg" height="32" alt="Donate using Bountysource"> </a> <a href="https://www.paypal.com/donate/?hosted_button_id=GEVR88FC9BWRW" target="_blank"> <img src="https://www.paypalobjects.com/webstatic/de_DE/i/de-pp-logo-200px.png" height="32" alt="Donate using PayPal"> </a> <!-- [![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/ts-thomas/) --> <br><br> Thanks a lot, Thomas (ts-thomas)

<a name="addon"></a>

Plugins / Add-ons / Extensions

Vue 2 and 3 (a wrapper component that adds the ability to mount Vue components in WinBox.js):<br> <a href="https://github.com/wobsoriano/vue-winbox">https://github.com/wobsoriano/vue-winbox</a>

A React controlled component for WinBox.js, with full Reactful props and state.:<br> <a href="https://github.com/rickonono3/react-winbox">https://github.com/rickonono3/react-winbox</a>

<a name="started"></a>

Getting Started

Get Latest Stable Build (Recommended):

<table> <tr> <td colspan=3"> <b><u>Bundle:</u></b> (all assets bundled into one single file: js + css + html + icons) </td> </tr> <tr> <td>winbox.bundle.min.js</td> <td><a href="https://github.com/nextapps-de/winbox/raw/0.2.82/dist/winbox.bundle.min.js" target="_blank">Download</a></td> <td><a href="https://rawcdn.githack.com/nextapps-de/winbox/0.2.82/dist/winbox.bundle.min.js" target="_blank">https://rawcdn.githack.com/nextapps-de/winbox/0.2.82/dist/winbox.bundle.min.js</a></td> </tr> <tr> <td colspan=3"> <br><b><u>Non-Bundled:</u></b> (js and css are separated, css includes icons as base64) </td> </tr> <tr> <td>winbox.min.js</td> <td><a href="https://github.com/nextapps-de/winbox/raw/0.2.82/dist/js/winbox.min.js" target="_blank">Download</a></td> <td><a href="https://rawcdn.githack.com/nextapps-de/winbox/0.2.82/dist/js/winbox.min.js" target="_blank">https://rawcdn.githack.com/nextapps-de/winbox/0.2.82/dist/js/winbox.min.js</a></td> </tr> <tr></tr> <tr> <td>winbox.min.css</td> <td><a href="https://github.com/nextapps-de/winbox/raw/0.2.82/dist/css/winbox.min.css" target="_blank">Download</a></td> <td><a href="https://rawcdn.githack.com/nextapps-de/winbox/0.2.82/dist/css/winbox.min.css" target="_blank">https://rawcdn.githack.com/nextapps-de/winbox/0.2.82/dist/css/winbox.min.css</a></td> </tr> <tr> <td colspan=3"> <br><b><u>Sources:</u></b> (not bundled at all, images as url to original resources) </td> </tr> <tr> <td>ES6 Modules</td> <td><a href="https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/nextapps-de/winbox/tree/0.2.82/src/js" target="_blank">Download</a></td> <td>The <i>/src/js</i> folder of this Github repository</td> </tr> <tr></tr> <tr> <td>LESS Files (source)</td> <td><a href="https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/nextapps-de/winbox/tree/0.2.82/src/css" target="_blank">Download</a></td> <td>The <i>/src/css</i> folder of this Github repository</td> </tr> <tr></tr> <tr> <td>winbox.css (compiled)</td> <td><a href="https://github.com/nextapps-de/winbox/raw/0.2.82/src/css/winbox.css" target="_blank">Download</a></td> <td><a href="https://rawcdn.githack.com/nextapps-de/winbox/0.2.82/src/css/winbox.css" target="_blank">https://rawcdn.githack.com/nextapps-de/winbox/0.2.82/src/css/winbox.css</a></td> </tr> <tr></tr> <tr> <td>src.zip</td> <td><a href="https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/nextapps-de/winbox/tree/0.2.82/dist" target="_blank">Download</a></td> <td>Download all source files including image original resources.</td> </tr> </table>

Get Latest (NPM):

npm install winbox

Use Bundled Version (Recommended)

The bundled version includes all assets like js, css, html and icon images as base64.

A best practice is to load the library as async and use some modern preloading mechanism:

<html> <head> <link rel="preload" href="winbox.bundle.min.js" as="script"> </head> <body> <!-- HTML CONTENT --> <!-- BOTTOM OF BODY --> <script src="winbox.bundle.min.js" async></script> <!-- YOUR SCRIPT --> <script src="my-script.js" defer></script> </body> </html>

When you get troubles with unavailable references then remove the async or defer from this example and invest some minutes later to find out how you can properly load js assets asynchronously today.

Use Non-Bundled Version

The non-bundled version needs to load js and css separately (css already includes icons as base64).

<html> <head> <link rel="stylesheet" href="winbox.min.css"> <script src="winbox.min.js"></script> </head> <body></body> </html>

You can also load the non-bundled version in the same way.

ES6 Modules

The ES6 modules are located in src/js/. But you need to load the stylesheet file explicitly since this is just automatically loaded by the bundled version.

<head> <link rel="stylesheet" href="dist/css/winbox.min.css"> </head>
<script type="module"> import WinBox from "./src/js/winbox.js"; </script>

You can also load modules via CDN, e.g.:

<script type="module"> import WinBox from "https://unpkg.com/winbox@0.2.82/src/js/winbox.js"; </script>

The ES6 modules are not minified. Please use your favored bundler or build tool for this purpose.

<a name="api"></a>

Overview

Constructor:

  • new <a href="#winbox.new">WinBox(title, options<key: value>)</a> : winbox

Global methods:

  • <a href="#winbox.new">WinBox.new(title, options<key: value>)</a> : winbox
  • <a href="#winbox.stack">WinBox.stack()</a> : Array<winbox>

Instance member methods:

  • <a href="#winbox.mount">winbox.mount(src)</a>
  • <a href="#winbox.unmount">winbox.unmount(dest)</a>
  • <a href="#winbox.setUrl">winbox.setUrl(string)</a>
  • <a href="#winbox.setTitle">winbox.setTitle(string)</a>
  • <a href="#winbox.setIcon">winbox.setIcon(url)</a>
  • <a href="#winbox.move">winbox.move(x, y)</a>
  • <a href="#winbox.resize">winbox.resize(width, height)</a>
  • <a href="#winbox.close">winbox.close(boolean)</a>
  • <a href="#winbox.focus">winbox.focus(state)</a>
  • <a href="#winbox.blur">winbox.blur(state)</a>
  • <a href="#winbox.hide">winbox.hide(state)</a>
  • <a href="#winbox.show">winbox.show(state)</a>
  • <a href="#winbox.minimize">winbox.minimize(state)</a>
  • <a href="#winbox.maximize">winbox.maximize(state)</a>
  • <a href="#winbox.fullscreen">winbox.fullscreen(state)</a>
  • <a href="#winbox.restore">winbox.restore(state)</a>
  • <a href="#winbox.setBackground">winbox.setBackground(string)</a>
  • <a href="#winbox.addClass">winbox.addClass(name)</a>
  • <a href="#winbox.removeClass">winbox.removeClass(name)</a>
  • <a href="#winbox.hasClass">winbox.hasClass(name)</a>
  • <a href="#winbox.toggleClass">winbox.toggleClass(name)</a>
  • <a href="#winbox.addControl">winbox.addControl(options)</a>
  • <a href="#winbox.removeControl">winbox.removeControl(name)</a>

Instance properties (readonly):

  • <a href="#winbox.id">winbox.id</a>
  • <a href="#winbox.index">winbox.index</a>
  • <a href="#winbox.window">winbox.window</a>
  • <a href="#winbox.body">winbox.body</a>

Instance properties (writable):

  • <a href="#winbox.x">winbox.x</a>
  • <a href="#winbox.y">winbox.y</a>
  • <a href="#winbox.width">winbox.width</a>
  • <a href="#winbox.height">winbox.height</a>
  • <a href="#winbox.top">winbox.top</a>
  • <a href="#winbox.right">winbox.right</a>
  • <a href="#winbox.bottom">winbox.bottom</a>
  • <a href="#winbox.left">winbox.left</a>
  • <a href="#winbox.minwidth">winbox.minwidth</a>
  • <a href="#winbox.minheight">winbox.minheight</a>
  • <a href="#winbox.maxwidth">winbox.maxwidth</a>
  • <a href="#winbox.maxheight">winbox.maxheight</a>

Instance state boolean properties (readonly):

  • <a href="#winbox.min">winbox.min</a>
  • <a href="#winbox.max">winbox.max</a>
  • <a href="#winbox.full">winbox.full</a>
  • <a href="#winbox.hidden">winbox.hidden</a>
  • <a href="#winbox.focused">winbox.focused</a>

Callback methods:

  • <a href="#winbox.oncreate">winbox.oncreate</a>
  • <a href="#winbox.onshow">winbox.onshow</a>
  • <a href="#winbox.onhide">winbox.onhide</a>
  • <a href="#winbox.onclose">winbox.onclose</a>
  • <a href="#winbox.onfocus">winbox.onfocus</a>
  • <a href="#winbox.onblur">winbox.onblur</a>
  • <a href="#winbox.onmove">winbox.onmove</a>
  • <a href="#winbox.onresize">winbox.onresize</a>
  • <a href="#winbox.onfullscreen">winbox.onfullscreen</a>
  • <a href="#winbox.onmaximize">winbox.onmaximize</a>
  • <a href="#winbox.onminimize">winbox.onminimize</a>
  • <a href="#winbox.onrestore">winbox.onrestore</a>

<a name="options" id="options"></a>

Options

<table> <tr></tr> <tr> <td>Option</td> <td>Values</td> <td>Description</td> </tr> <tr> <td>id</td> <td>number | string</td> <td>Set a unique id to the window. Used to define custom styles in css, query elements by context or just to identify the corresponding window

编辑推荐精选

Vora

Vora

免费创建高清无水印Sora视频

Vora是一个免费创建高清无水印Sora视频的AI工具

Refly.AI

Refly.AI

最适合小白的AI自动化工作流平台

无需编码,轻松生成可复用、可变现的AI自动化工作流

酷表ChatExcel

酷表ChatExcel

大模型驱动的Excel数据处理工具

基于大模型交互的表格处理系统,允许用户通过对话方式完成数据整理和可视化分析。系统采用机器学习算法解析用户指令,自动执行排序、公式计算和数据透视等操作,支持多种文件格式导入导出。数据处理响应速度保持在0.8秒以内,支持超过100万行数据的即时分析。

AI工具使用教程AI营销产品酷表ChatExcelAI智能客服
TRAE编程

TRAE编程

AI辅助编程,代码自动修复

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

热门AI工具生产力协作转型TraeAI IDE
AIWritePaper论文写作

AIWritePaper论文写作

AI论文写作指导平台

AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。

数据安全AI助手热门AI工具AI辅助写作AI论文工具论文写作智能生成大纲
博思AIPPT

博思AIPPT

AI一键生成PPT,就用博思AIPPT!

博思AIPPT,新一代的AI生成PPT平台,支持智能生成PPT、AI美化PPT、文本&链接生成PPT、导入Word/PDF/Markdown文档生成PPT等,内置海量精美PPT模板,涵盖商务、教育、科技等不同风格,同时针对每个页面提供多种版式,一键自适应切换,完美适配各种办公场景。

热门AI工具AI办公办公工具智能排版AI生成PPT博思AIPPT海量精品模板AI创作
潮际好麦

潮际好麦

AI赋能电商视觉革命,一站式智能商拍平台

潮际好麦深耕服装行业,是国内AI试衣效果最好的软件。使用先进AIGC能力为电商卖家批量提供优质的、低成本的商拍图。合作品牌有Shein、Lazada、安踏、百丽等65个国内外头部品牌,以及国内10万+淘宝、天猫、京东等主流平台的品牌商家,为卖家节省将近85%的出图成本,提升约3倍出图效率,让品牌能够快速上架。

iTerms

iTerms

企业专属的AI法律顾问

iTerms是法大大集团旗下法律子品牌,基于最先进的大语言模型(LLM)、专业的法律知识库和强大的智能体架构,帮助企业扫清合规障碍,筑牢风控防线,成为您企业专属的AI法律顾问。

SimilarWeb流量提升

SimilarWeb流量提升

稳定高效的流量提升解决方案,助力品牌曝光

稳定高效的流量提升解决方案,助力品牌曝光

Sora2视频免费生成

Sora2视频免费生成

最新版Sora2模型免费使用,一键生成无水印视频

最新版Sora2模型免费使用,一键生成无水印视频

下拉加载更多