views:

129

answers:

1

Hello guys,

I'm trying to implement Simplemodal on my website. Simple text boxes are really easy to do, but I can't find a way to have another page showing through AJAX. I know very little about Jquery and there is no documentation on how to do it, so could somebody help me? Thanks.

This is the default code of a Simple Modal box:

jQuery(function ($) {
$('#basic-modal .basic').click(function (e) {
    $('#basic-modal-content').modal();

      return false;
});});

This is some code I took from the Simple Modal contact form that works with AJAX. I've been trying to tweak it but I don't really understand the structure of it. As I said, I'm completely new to Jquery.

                $.get("data/contact.php", function(data){
                // create a modal dialog with the data
                $(data).modal({
                    closeHTML: "<a href='#' title='Close' class='modal-close'>x</a>",
                    position: ["15%",],
                    overlayId: 'contact-overlay',
                    containerId: 'contact-container',
                    onOpen: contact.open,
                    onShow: contact.show,
                    onClose: contact.close
                });
            });
        });
A: 

i can't see exactly the problem is without fully code of your page.

how about change this code :

$(data).modal({ 

to be :

$('#basic-modal-content').modal({ 

after this line:

$.get("data/contact.php", function(data){

before this line:

$('#basic-modal-content').modal({ 

write this code :

$('#basic-modal-content').html(data);
soebedjo
Thanks this is working and should do it!
Maxime
ur welcome... ;)
soebedjo