Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Miguel Rocha1

O melhor modal

Recommended Posts

Bem o melhor modal é aquele que vai se adequar ao seu layout/necessidade, se você consegue implementar mais rápido ou de identifica com algum já é um começo, ambos postados são bons.

 

Deixarei minha contribuição também:

http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/#prettyPhoto

 

Esse acima eu gosto pois como tem suporte aos botões do twitter e facebook (não preciso ter trabalho de gerar URL e colocar eles no modal) atende a certas necessidade de alguns designs que faço.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Eu criei um modal simples que atende minhas necessidades, talvez possa ajudar.

Para usá-la é necessario ter jquery e jqueryui instalados;

<script>
/*!
 *  JIR TEC WEB (JTW Library)
 *  JTW Version 1.0    
 *   
 *  Date    : 2014-01-01
 *  Author  : GAMA Jonatas Miranda <jonatas.m.gama@gmail.com>
 *                         
 *  Web site: http://www.jirtecweb.com.br/
 *  dual licence :  http://www.cecill.info/licences/Licence_CeCILL_V2-fr.html
 *                  http://www.gnu.org/licenses/gpl.html
 */
$(function() {
function criaModal() {
    $('#jan').remove();
    $("<div id='jan'><div id='fechar'><b><img src='imgs/icones/excluir.gif'/></b></div><div id='pop'></div></div>").prependTo('body');
    $('#pop').html('<h3>Carregando...</h3>');
    $("#jan").draggable();
}
function jirModal(param) {
    criaModal();
    $('#pop').html(param);
    $('#jan').hide('fast', function() {
        largura = $('#jan').width();
        altura = $('#jan').height();
        esquerda = largura / 2;
        topo = altura / 2;
        $('#jan').css({
            'clear': 'right',
            'position': 'fixed',
            'width': largura + 'px',
            'height': altura + 'px',
            'left': ' 50%',
            'top': '50%',
            'margin-left': -esquerda + 'px',
            'margin-top': -topo + 'px'
        });
    });
    $('#jan').slideDown();

}
 
   $(document).on('click', "#fechar b,#fJan", function(e) {
        e.preventDefault();
        $('#jan').fadeOut(function() {
            $(this).remove();          
        });
    });
$(document).on('click', ".modal", function(e) {
        e.preventDefault();
        url = $(this).attr('href');
        jirModal(url);
    });
});
 
</script>
 
 
<a  class='modal' href='umapagina.php'>Um texto</a>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.