Trouble with dialogs

Trouble with dialogs

Hello!

      For three days I trying to fix my problem and I can't do it. I think live example was good idea. I have problem with dialogs on my site. You can check it on http://www.knights.pl.

When you click "Tawerna" (this is forum) and when subpage was loaded first time everythink works fine, but when you click "Tawera" one more time page loaded successful, if you click "Zarządzaj moim kontem" dialog open, but buttons don't work. If you close and reopen dialog everythink works fine...

It is my code:

Open dialog:
  1. [code]$(document).ready(function(){       
    $("#twojekonto").button().click(function() {

    $("#dialog_forum_calosc").load('tawerna/forum_konto.php').dialog({height: 300,    resizable: false,    width: 600,     modal: true, draggable: false,    show: 'fade', hide: 'fade'
     }); }
    );

    });







Script to load subpage:


  1. function ajax_link(class) {   
       
        //References
        var loading = $("#top_zegar");
        var container = $("#zawartosc");
       


       
        $(class).click(function(){

           
           
                $.ajax({
                        type: "GET",
                        url: $(this).attr("href"),
                        async: false,
                        dataType: "html",
                        cache: false,
                        beforeSend: function() {        showLoading();        },
                        complete: function() {        hideLoading();    container.css({opacity:"1"}); },
                        success: function(msg) {        container.html(msg);            },
                          error: function (XMLHttpRequest, textStatus, errorThrown) {            container.html('<center><b>Wystapil blad podczas wczytywania strony!</b></center>');            }
                    });   
                   
            //prevent default action
            return false;
           
           
        });

        //show loading bar
    function showLoading(){
            loading.css({visibility:"visible"}).css({display:"block"}).css({opacity:"1"});
            container.css({opacity:"0.3"});   
       

        }
       
        //hide loading bar
    function hideLoading(){    loading.css({opacity:"0"});    };


    }











































And links:

  1. $(document).ready(function() {
    ajax_link('a.ajax-link');
    });[/code]

    [code]<a class="ajax-link" href="news.php">Początek</a><br>





Can any one help me?












    • Topic Participants

    • thron