Ha! I got that to work! BUT...it does not work correctly for IE6. It
loads snappy in all modern browsers and works, but it take up to 15
seconds for IE to unfreeze. Why? We have a strange corporate version
of IE6 that is slower than mud and all caching is turned off. The HTML
i'm loading is 50 records with a 4 graphics each, so it stacks up 200
calls to the server. You can see the calls in the footer. The graphics
are all the same too. But this only seems to be an issue with "get".
The close button binds just fine, but since IE6 is a corporate
standard still where I work, I can't use this method.

The second example above loads perfectly snappy in IE6 because it's
using load. I thought load was really just a masked "get", but for
whatever reason, it works perfect. BUT the button is not bound
correctly in that version. Here is the code again:

                $("#button-sales").click(function(event) {

                        
$("#modalContentInstSales").load("includes/institutional-
sales.html");

                        $('#modalContentInstSales').modal({
                                onClose: modalClose,
                                onOpen: modalOpen,
                                containerCss: {
                                        height: 420,
                                        width: 342
                                },
                                onShow: function (dialog){
                                        $("#modalContentInstSales 
.simplemodal-close").click(function (e)
{
                                                $.modal.close();
                                        });
                                }
                        });
                });

I'm trying a few ways to get at the div with the simplemodal-close
class on it, but no luck yet. Any clues? So close...

Doug



On Mar 30, 11:15 pm, Eric Martin <emarti...@gmail.com> wrote:
> Doug,
>
> In your first example, the data is not in the DOM yet. Try something
> like:
>
> $("#button-sales").click(function(e) {
>         e.preventDefault();
>         $.get("includes/institutional-sales.html", function(data){
>                 // create a modal dialog with the data
>                 $('<div>' + data + '</div>').modal({
>                         onClose: modalClose,
>                         onOpen: modalOpen,
>                         containerCss: {
>                                 height: 420,
>                                 width: 342
>                         }
>                 }); // contains a button with simplemodal-close class
>         });
>
> });
>
> If that doesn't work, let me know ;)
>
> -Eric
>
> On Mar 30, 1:07 pm, dbonneville <doug.bonnevi...@gmail.com> wrote:
>
> > I have this example too. I have the data loaded, and onShow will
> > trigger an alert if I put one in, but the close button still does not
> > work:
>
> > $("#button-sales").click(function(event) {
>
> >                         
> > $("#modalContentInstSales").load("includes/institutional-
> > sales.html");
>
> >                         $('#modalContentInstSales').modal({
> >                                 onClose: modalClose,
> >                                 onOpen: modalOpen,
> >                                 containerCss: {
> >                                         height: 420,
> >                                         width: 342
> >                                 },
> >                                 onShow: function (dialog){
> >                                         $(".simplemodal-close", 
> > dialog.data).click(function (e) {
> >                                                 e.preventDefault();
> >                                                 $.modal.close();
> >                                         });
> >                                 }
> >                         });
> >                 });

Reply via email to