Categories: JQuery, Plugins jQuery - Tags: css, jquery.plugin, xhtmlBuenas tardes!! Como ven sigo experimentando y haciendo plugins para JQuery.
Hoy se me dio por hacer uno bastante gracioso basado en las explicaciones de lanrat acerca de como construir un cubo usando las nuevas propiedades CSS.

Su utilización es muy sencilla, tan solo necesitamos 3 objetos ( las caras visibles del cubo) dentro de un objeto contenedor. Dichos objetos pueden ser links , imágenes, otros divs, etc
1
2
3
4
5
| <div class="cube">
<div><img src="1.jpg" /></div>
<div><img src="2.jpg" /></div>
<div><img src="3.jpg" /></div>
</div> |
<div class="cube">
<div><img src="1.jpg" /></div>
<div><img src="2.jpg" /></div>
<div><img src="3.jpg" /></div>
</div>
Una vez que tenemos nuestra estructura HTML armada debemos aplicar el plugin de la siguiente forma:
1
2
3
4
5
6
7
8
| <script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.jcubeit.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.cube').JcubeiT();
});
</script> |
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.jcubeit.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.cube').JcubeiT();
});
</script>
Y voila!! Tendremos un cubo perfecto con el cual podremos hacer un poco más original nuestros diseños.
El plugin posee algunos valores por defecto que se pueden cambiar pasando opciones.
- size:’200px’
- background: ‘#666’
- border: true
- borderColor: ‘#000’
- rounded: false
Podemos cambiar estos valores pasando las opciones como se suele hacer en JQuery
1
2
3
4
5
| var opciones={ size:'100px' , border: false};
$('.cube').JcubeiT(opciones);
//o simplemente
$('.cube').JcubeiT({ size:'100px' , border: false}); |
var opciones={ size:'100px' , border: false};
$('.cube').JcubeiT(opciones);
//o simplemente
$('.cube').JcubeiT({ size:'100px' , border: false});
Jugando con las opciones podremos crear por ejemplo una barra de menu más original

Pueden ver el ejemplo online o descargarse el código desde la página oficial de JQuery
ENGLISH
Hello!As you see im still experiencing and doing plugins for JQuery
Today I did a pretty funny one based on the explanations of lanrat about how to build a cube using new CSS properties.

Its use is very simple, you only need 3 objects (the visible faces of the cube) inside of a container object. Such objects could be links, images, other divs, etc.
1
2
3
4
5
| <div class="cube">
<div><img src="1.jpg" /></div>
<div><img src="2.jpg" /></div>
<div><img src="3.jpg" /></div>
</div> |
<div class="cube">
<div><img src="1.jpg" /></div>
<div><img src="2.jpg" /></div>
<div><img src="3.jpg" /></div>
</div>
Once we have our HTML structure we have to apply the plugin like this:
1
2
3
4
5
6
7
8
| <script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.jcubeit.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.cube').JcubeiT();
});
</script> |
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.jcubeit.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.cube').JcubeiT();
});
</script>
And voila! We will have a perfect cube to be a little more original in our designs.
The plugin has some defaults values that can be changed via the options var.
- size:’200px’
- background: ‘#666’
- border: true
- borderColor: ‘#000’
- rounded: false
We may change these values from the options as is usually done in JQuery
1
2
3
4
5
| var opciones={ size:'100px' , border: false};
$('.cube').JcubeiT(opciones);
//or just
$('.cube').JcubeiT({ size:'100px' , border: false}); |
var opciones={ size:'100px' , border: false};
$('.cube').JcubeiT(opciones);
//or just
$('.cube').JcubeiT({ size:'100px' , border: false});
Playing with the options we can create for example a more original menu bar

You can check the online demo or download the plugin from JQuery
Últimos Comentarios