Weblosofia com CSS, Jquery, Javascript, Ajax, PHP etc.
por Alexandre Magno
Postado em Março 23rd, 2008 por Alexandre Magno
Este plugin centraliza qualquer elemento através do método CSS da margem negativa.
Sem nenhum argumento, o método do plugin cetraliza horizontalmente e verticalmente.
$("class_or_id").center();
$("class_or_id").center({ horizontal: false // somente vertical }); $("class_or_id").center({ vertical: false //somente horizontal });
http://plugins.jquery.com/project/elementcenter
Este plugin foi testado no IE 6, IE 7, Safari 3, Firefox 2+
Este plugin requer o Dimensions plugin para funcionar corretamente
http://www.alexandremagno.net/jquery/plugins/center
http://code.google.com/p/jquerydevbrazil/wiki/jQueryCenterPlugin
http://code.google.com/p/jquerydevbrazil/downloads/list
Alexandre Magno - http://www.alexandremagno.net
Tales comentou:
24th Março, 2008 às 10:53 am
Boa Alex!
A maioria dos desenvolvedores HTML/CSS precisam centralizar elementos. Bem prático e fácil de usar o plugin.
Parabéns! :>)
john comentou:
26th Março, 2008 às 2:50 am
Hi, I came across your plugin looks good. I have a question of why you chose GPL over MIT or BSD license for a simple utility. Using the gpl will cause people pass over it since it would require them to license all of their code under the gpl.
Good work by the way.
admin comentou:
26th Março, 2008 às 9:42 am
Good point John. After a research I moved to MIT license. I would like the orientation to how I can put my plugins in jQuery plugins repository…
Very thanks…
h0tzen comentou:
3rd Abril, 2008 às 3:54 pm
you have to add return this; to make the center()-method chainable!
admin comentou:
4th Abril, 2008 às 9:56 am
Take a look hotzen:
http://code.google.com/p/jquerydevbrazil/source/browse/trunk/jquery.center.js
I made the change… thanks for suggestion!
nuno comentou:
14th Abril, 2008 às 11:33 am
okay, mais uma vez subiste na minha consideração
um grande abraço and good dev
Wilton José comentou:
2nd Julho, 2008 às 2:26 pm
Muito bom o seu plugin estou usando e está funcionando bem no IE 6/7 e no firefox 2. Já no firefox 3 ele não funciona legal. Testei no Ubuntu 8.04 com o firefox 3.
[]s
Wilton
Os seguintes campos estão incorretos ou faltando