j-InfoWindows
- Υποστήριξη κινητών συσκευών
- Υποστηρίζει το Touch
- Κινούμενος
- Επαναστατική
ΕΠΙΤΡΟΦΗ:
- Όλα τα παράθυρα
reoffsetresize {Boolean}θα επανασυνδεθούν σύμφωνα με τη διάσταση του παραθύρουmain(προεπιλογή:true)
Το συστατικό InfoWindows αναμένει το Array των αντικειμένων.
// Component declaration
var win = {
// Component ID
id: 'WINDOW_ID',
// NEW: cachekey for similar windows
// Optional, default: window ID
cachekey: 'WINDOW_ID',
// Positioning
// You can define specific display size and if the display size is not specified then the window tries to find a size for larger display
html: 'THE CONTENT OF WINDOW', // or can be raw HTMLElement
offset: { x: 200, y: 100, width: 600, height: 400, minwidth: 200, minheight: 200, maxwidth: 1000, maxheight: 1000 }, // minwidth, maxwidth, maxheight, minheight are optional
// Default settings
actions: { move: true, close: true, hide: true, resize: true, minimize: true, maximize: true, autosave: false },
// GOOD TO KNOW:
// "undefined" close or "close:false" and "hide:true" doesn't destroy the instance of window (it will be hidden only)
// A window title
title: 'Title for the window',
// Handlers (optional):
destroy: function() {
// @el {jQuery} a content of the window
// @this {Instance}
// is executed when the window is destroyed
},
make: function(el) {
// @el {jQuery} a content of the window
// @this {Instance}
// this.meta {Object} a reference to window object
// this.element {jQuery} a content element of the window
// this.container {jQuery} a main content element of the window
// this.main {Object} a reference to "Windows" component
// this.width {Number} a width of window
// this.height {Number} a height of the content of the window
// this.x {Number} offset X
// this.y {Number} offset Y
// Methods:
// this.setsize(width, height);
// this.setcommand(cmd); Allowed commands: "close", "maximize", "resetmaximize", "togglemaximize", "minimize", "resetminimize", "toggleminimize", "resize", "move", "focus"
// this.setoffset(x, y);
// is executed when the window is making
},
data: function(type, data, el) {
// @type {String}
// @data {Object}
// @el {jQuery} a content element of the window
// @this {Instance}
// is executed when data are sent via SETTER('windows', 'send', 'TYPE', 'DATA')
},
resize: function(width, height, el, x, y) {
// @width {Number}
// @height {Number}
// @el {jQuery} a content of the window
// @this {Instance}
// is executed when the window is resized
},
move: function(x, y, el) {
// @x {Number}
// @y {Number}
// @el {jQuery} a content of the window
// @this {Instance}
// is executed when the window is moved
},
service: function(counter, el) {
// @counter {Number} count of calls
// @el {jQuery} a content of the window
// @this {Instance}
// the component will execute this handler each 5 seconds
}
};
PUSH('infowindows', win);Μέθοδοι:
- Το
component.finditem(window_id)βρίσκει το συγκεκριμένο παράθυρο σύμφωνα με τοID - Το
component.show(window_id)δείχνει ένα παράθυρο - Το
component.hide(window_id)κρύβει ένα παράθυρο component.toggle(window_id)Βάλτε ένα παράθυρο- Το
component.focus(window_id)επικεντρώνεται σε ένα παράθυρο - Το
component.close(window_id)κλείνει ένα παράθυρο
Χρησιμοποιήστε το με <ui-component name="infowindows">Όταν το στοιχείο δεν έχει φορτωθεί ακόμα, jComponent Κατεβάστε το για πρώτη φορά από τη διεύθυνση DEF.fallback (Η Componentator Συγγραφέας: Peter Širka. πηγή: το Componentator Ετικέτες Αξιολόγηση, MIT άδεια.
<style>
body { padding: 0; margin: 0; overflow: hidden; }
</style>
<ui-component name="infowindows" path="mywindows"></ui-component>
<script>
var mywindows = [];
mywindows.push({
id: 'A',
offset: { x: 200, y: 100, width: 600, height: 400, minwidth: 200, minheight: 200 },
title: 'A',
html: '<div class="padding">Lorem ipsum dolor sit amet.</div>',
actions: { minimize: true, maximize: true, move: true, resize: true, close: true }
});
mywindows.push({
id: 'B',
offset: { x: 600, y: 300, width: 600, height: 400, minwidth: 200, minheight: 200 },
title: 'B',
html: '<div class="padding">Lorem ipsum dolor sit amet.</div>',
actions: { minimize: true, maximize: false, move: true, resize: true, close: true }
});
</script>