IconDock
De Wikicon
This article is also avaliable in english.
Este artículo también está disponible en castellano.
Contingut |
[edita] iconDock jQuery Plugin
iconDock és un plugin per la llibreria de JavaScript jQuery que permet crear per a la web l'efecte dock del menú del sistema operatiu Mac OS X.
La idea està basada en el Google X, una primera aproximació que va fer Google per crear aquest efecte en web.
[edita] Exemple
Pots veure un exemple de funcionament aquí: http://icon.cat/software/iconDock/0.8b/dock.html
[edita] Descàrrega de la versió 8.0 beta (actual)
- Versió comprimida (3KB)
- Versió descomprimida (codi font) (8KB)
[edita] Descàrrega d'altres versions
0.8b.
[edita] To Do List (llistat de coses pendents de fer)
- Poder ordenar els elements del menú Drag&Drop.
- Poder afegir i treure elements.
- Afegir una capa informativa (globus) al rollover de cada icona.
[edita] Bugs To Fix (llistat de coses pendents corregir)
[edita] Grup del projecte
He creat un Grup de distribució de correu del projecte a Google per si algú s'anima a col·laborar o té alguna consulta.
Enllaç al grup: http://groups.google.com/group/icondock/
[edita] Ús
- Pas 1.- Incrustar la llibreria jQuery al HEAD de la pàgina i el plugin iconDock a continuació.
<html> <head> [...] <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.dock.js"></script> </head> <body> [...] </body> <html>
- Pas 2.- Generar dues imatges per cada icona: codiimatge_x.gif (o .jpg o .png) i codiimatge_X.gif (o .jpg o .png), on x és el tamany del costat de la imatge petita, i X el tamany del costat de la imatge gran.
- Pas 3.- Crear un element HTML (DOM) amb una id determinada que contingui una llista d'elements <img> dins d'elements <a>.
<div id="BarraPersonalitzada"> <a href="http://siknus.com/1" name="Alertes_name" title="Google alertes"> <img src="img/alerts_35.gif" alt="Campana_alt" border="0" /> </a> <a href="http://siknus.com/2" name="Escriptori_name" title="Google Escriptori"> <img src="img/desktop_35.gif" alt="Escriptori_alt" border="0" /> </a> <a href="http://siknus.com/3" name="Compres_name" title="Google compres"> <img src="img/froogle_35.gif" alt="Froogle_alt" border="0" /> </a> <a href="http://siknus.com/4" name="GMail_name" title="Google mail"> <img src="img/gmail_35.gif" alt="Gmail_alt" border="0" /> </a> <a href="http://siknus.com/5" name="Grups_name" title="Google grups"> <img src="img/groups_35.gif" alt="Grups_alt" border="0" /> </a> <a href="http://siknus.com/6" name="Linux_name" title="Linux"> <img src="img/special_35.gif" alt="Especial_alt" border="0" /> </a> </div>
- Pas 4.- (opcional) Configurar el menú (llegir la següent secció per conèixer les opcions de configuració).
- Pas 5.- Afegir cada menú amb la funció jQuery('#idOfTheSelectedElement').addDockEffect(confObject);
<script type="text/javascript">
var confObject = {
iconMinSide : 35,
iconMaxSide : 70,
distAttDock : 100,
coefAttDock : 2,
veloOutDock : 500,
valign: 'bottom'
}
jQuery(function() {
jQuery("#BarraPersonalitzada").addDockEffect(confObject);
});
</script>
[edita] Configuració
var conf = {
iconMinSide : 35,
iconMaxSide : 70,
distAttDock : 100,
coefAttDock : 2,
veloOutDock : 500,
valign: 'bottom'
}
[edita] iconMinSide
Tamany mínim de les icones.
Valors recomanats: entre 20 i 50 pixels.
[edita] iconMaxSide
Tamany màxim de les icones.
Valors recomanats: entre 70 i 140 pixels.
[edita] distAttDock
Distància d'atenuació de l'efecte. Distància entre el cursor i cadascun dels extrems on ja no hi ha l'efecte d'ampliació.
Valors recomanats: Depèn del nombre d'icones i el tamany mínim. Un bon valor seria una tercera part del que fa el menú quan no hi ha el cursor a sobre.
[edita] coefAttDock
Coeficient d'atenuació del dock. Si l'atenuació és més progressiva o més brusca.
Valors recomanats: Entre 0,5 i 2,5.
[edita] veloOutDock
Velocitat de replegament o desplegament del menú. El temps que es triga des que es surt de sobre del menú fins que torna a la posició inicial.
Valors recomanats: Entre 0,5 i 2 segons.
[edita] valign
Alineació vertical de les icones (horitzontalment sempre es centren).
Valors: 'top', 'bottom' o 'middle'.
[edita] Navegadors provats
- PC & Windows XP
- Mozilla Firefox 2.0
- Internet Explorer 6.0
- Internet Explorer 7.0
- Apple Mac & Mac OS X
- Mozilla Firefox 1.5
- Safari 2.0
[edita] Llicència
iconDock jQuery Plugin es publica sota les mateixes llicències que la llibreria jQuery:
/* * iconDock jQuery plugin * http://icon.cat/software/iconDock * * Copyright (c) 2007 Isaac Roca & icon.cat (iroca@icon.cat) * Dual licensed under the MIT and GPL licenses. * * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * */
Llicència MIT
iconDock jQuery plugin http://icon.cat/software/iconDock Copyright (c) 2007 Isaac Roca & icon.cat (iroca@icon.cat) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Llicència GPL
iconDock jQuery plugin http://icon.cat/software/iconDock Copyright (C) 2007 Isaac Roca & icon.cat (iroca@icon.cat) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.


