moveable windows jdoor - Free Download Windows-like Moveable Windows In jQuery - jDoor

Free Download Windows-like Moveable Windows In jQuery – jDoor

Posted on

This time I will share jQuery Plugin and tutorial about Windows-like Moveable Windows In jQuery – jDoor, hope it will help you in programming stack.

moveable windows jdoor - Free Download Windows-like Moveable Windows In jQuery - jDoor
File Size: 17 KB
Views Total: 434
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

jDoor is a tiny jQuery plugin to create customizable and moveable dialog windows on the page.

These windows behave almost like Microsoft Windows. They can get or lose the focus and you can move them with your mouse around the screen.

How to use it:

1. Load the main script and core stylesheet in the document.

1 <link rel="stylesheet" href="/path/to/jdoor/jdoor.css" />
2 <script src="/path/to/cdn/jquery.slim.min.js"></script>
3 <script src="/path/to/jdoor/jdoor.js"></script>

2. Create a moveable window on the screen using the following parameters:

  • targetscreenId: The jQuery-selector for the target screen. E.g. ‘#mytargetscreen’, ‘div’
  • windowId: The (html) name and id of the window. Used for further processing of the end user.
  • x: Left position of the window on the targetscreen (in pixels). Use ‘center’ to center it horizontally.
  • y: Top position of the window on the targetscreen (in pixels). Use ‘center’ to center it vertically.
  • width: Width of the window in pixels. If the content overflows the window, a scrollbar will be shown. Use ‘auto’, ‘dynamic’ or ‘dyn’ to use the content’s width. You can also use a negative number to set the “max-width” instead of the “width”.
  • height: Height of the window in pixels.
  • title: Text to be shown in the top bar of the window.
  • content: Content of the window (HTML).
1 // $(targetscreenId).jdCreateWindow(windowId, x, y, width, height, title, content)
2 $('#targetContainer').jdCreateWindow('my_window_id', 100,100, 'dyn', -50, "A window", "This is <br />just<br /> a<br /> window. <div style='width:40px; height:40px; background-color: #FA0;'></div>");

3. Embed a Youtube video into the moveable Window.

  • youtubeid: Video ID
1 // $(targetscreenId).jdCreateYoutubeWindow(windowId, x, y, width, height,title, youtubeid)
2 $('#targetContainer')jdCreateYoutubeWindow('youtube_window', 100,150, 200,'dyn',"Youtube Window", "8Ltr_IkvKmc");

4. Show & hide the moveable Window.

1 // show a window
2 $(windowId).jdShow();
3  
4 // remove all windows
5 $(targetscreenId).jdHideAllWindows();

5. Replace the content of a window.

1 $(windowId).jdHTML(html);

6. Override the default styles of the window.

01 .jdwindow {
02   border: 2px solid #FC2C25;
03   background-color: #222222;
04   color: #FFF;
05   font-family: 'Roboto';
06   font-size: 12px;
07 }
08  
09 .jdwindow-top {
10   background-color: #FC2C25;
11   padding-left: 5px;
12 }
13  
14 .jdwindow-hide{
15   background-color: #911;
16   font-size: 16px;
17   text-align: center;
18 }