fxdmcuong / simplemodal

Automatically exported from code.google.com/p/simplemodal
0 stars 0 forks source link

can not reopen after $.modal.close() #67

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
SimpleModal or SimpleModal Contact Form (SMCF)?

Version of SimpleModal of SMCF (indicate Demo or WordPress plugin)?
1.4.1

Version of jQuery?
1.5.2

Browser/OS you are experiencing the problem with?
IE6 opera11 chrome9

If applicable, please provide a code snippet or link to a website
demonstrating the problem.
jQuery(function ($) {
    // Load dialog on page load
    //$('#basic-modal-content').modal();

    // Load dialog on click
    $('#basic-modal .basic').click(function (e) {
        $('#basic-modal-content').modal();
        $.modal.close();
        $('#basic-modal-content').modal();
        return false;
    });
});
when run this code, nothing will happen

If applicable, please list the other code/libraries/plugins you are trying
to integrate with.

Original issue reported on code.google.com by kvo.s...@gmail.com on 13 May 2011 at 10:30

GoogleCodeExporter commented 8 years ago
but this code will run

jQuery(function ($) {
    // Load dialog on page load
    //$('#basic-modal-content').modal();

    // Load dialog on click
    $('#basic-modal .basic').click(function (e) {
        $('#basic-modal-content').modal();
        $.modal.close();
        setTimeout(function(){
            $('#basic-modal-content').modal();
        }, 500);
        return false;
    });
});

Original comment by kvo.s...@gmail.com on 13 May 2011 at 10:33

GoogleCodeExporter commented 8 years ago
There is an issue with a setTimeout in the close function (which was there to 
fix an Opera issue).

Until I can fix the issue, there are a couple of possible fixes:
http://stackoverflow.com/questions/4870465/click-link-in-simple-modal-to-open-ne
w-simple-modal
http://stackoverflow.com/questions/5406576/simplemodal-calling-modal-on-the-same
-element/5408785#5408785

Original comment by emartin24 on 17 May 2011 at 4:03

GoogleCodeExporter commented 8 years ago
maybe jquery.queue can solve the problem

Original comment by kvo.s...@gmail.com on 20 May 2011 at 3:35

GoogleCodeExporter commented 8 years ago
i was also facing the same problem to reopen the div than i set the time out

$('#basic-modal-content').modal();
$.modal.close();
setTimeout(function(){$('#basic-modal-content').modal();},0);
$('#basic-modal-content').modal();

and it worked for me ...........also......

Original comment by rahul123...@gmail.com on 13 Jul 2011 at 5:51