Ir para conteúdo

POWERED BY:

Arquivado

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

gatagabyby13

Abrindo um Modal e fechando o outro

Recommended Posts

  <script type="text/javascript">
       $(function () {
           // Dialog			
           $('#dialog').dialog({
               open: function (event, ui) { $(".ui-dialog-titlebar-close").hide(); },
               autoOpen: false,
               width: 650,
               height: 300,
               resizable: false,
               buttons: {
                   "OK": function () {
                       $(this).dialog("");
                   },
                   "Cancelar": function () {
                       $(this).dialog("close");
                   }
               }
           });
           $('#botao').click(function () {
               $('#dialog').dialog('open');        
               $('#dialog_01').dialog("close");
               $('#dialog_02').dialog("close");
               $('#dialog_03').dialog("close");
               return false;
           });
       });
   </script>
   <script type="text/javascript">
       $(function () {
           // Dialog			
           $('#dialog_01').dialog({
               open: function (event, ui) { $(".ui-dialog-titlebar-close").hide(); },
               autoOpen: false,
               width: 600,
               height: 250,
               resizable: false,
               buttons: {
                   "OK": function () {
                       $(this).dialog("");
                   },
                   "Cancelar": function () {
                       $(this).dialog("close");
                   }
               }
           });
           $('#radio_01').click(function () {
               $('#dialog_01').dialog('open');
               $('#dialog').dialog("close");
               $('#dialog_02').dialog("close");
               $('#dialog_03').dialog("close");

               return false;
           });
       });
   </script>
   <script type="text/javascript">
       $(function () {
           // Dialog			
           $('#dialog_02').dialog({
               open: function (event, ui) { $(".ui-dialog-titlebar-close").hide(); },
               autoOpen: false,
               width: 600,
               height: 250,
               resizable: false,
               buttons: {
                   "OK": function () {
                       $(this).dialog("");
                   },
                   "Cancelar": function () {
                       $(this).dialog("close");
                   }
               }
           });
           $('#radio_07').click(function () {
               $('#dialog_02').dialog('open');
               $('#dialog_03').dialog("close");
               $('#dialog_01').dialog("close");
               $('#dialog').dialog("close");

               return false;
           });
       });
   </script>
   <script type="text/javascript">
       $(function () {
           // Dialog			
           $('#dialog_03').dialog({
               open: function (event, ui) { $(".ui-dialog-titlebar-close").hide(); },
               autoOpen: false,
               width: 650,
               height: 300,
               resizable: false,
               buttons: {
                   "OK": function () {
                       $(this).dialog("");
                   },
                   "Cancelar": function () {
                       $(this).dialog("close");
                   }
               }
           });
           $('#radio_10').click(function () {
               $('#dialog_03').dialog('open');
               $('#dialog').dialog("close");
               $('#dialog_02').dialog("close");
               $('#dialog_01').dialog("close");

               return false;
           });
       });
   </script>

Pessoal boa tarde, estou com um problema,

 

tenho um Modal(Pop-up) onde eu tenho cinco radios bootons com respectivos links

que ao clicar em cada um deles, vai fechar o modal atual e abrir outro.

só que só está funcionando em uma das radios, o código está certo para todos, mas não sei o que acontece,

preciso de ajuda.

Compartilhar este post


Link para o post
Compartilhar em outros sites

tente usar o .live() ou o .delegate() para atrelar o click aos teus radios.

 

pois o modal reconstroi o html, e isso tira os elementos do fluxo.

Compartilhar este post


Link para o post
Compartilhar em outros sites

leia que você vai entender:

http://wbruno.com.br/blog/2011/03/18/metodo-live-jquery/

 

qndo tiver dúvidas assim, pesquise com base na dica q dei. É a melhor forma de aprender.

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.