0

I am trying to add a jscrollpane to a dialog once the dialog is loaded. I tried using the dialogopen and dialogfocus events but it seems these trigger too early. Is there an event I can subscribe to that tells me the dialog is fully loaded and displayed and its safe to call jscrollpane? Right now i'm just adding a half second timeout but that seems hacky and shows the user a broken dialog for a half second.

Any other solutions would also be welcome.

$("#diagBox").load($(this).attr('href'), function() {
        $dialog.imagesLoaded(function() {

            $dialog.dialog('open');
            $dialog.dialog("option", "position", "center");
            setTimeout(function(){
                $('input, textarea').placeholder();
                $('.scroller').jScrollPane();
                positionElements();
            },500);


        });
    });
Lumpy
  • 3,632
  • 4
  • 34
  • 58

0 Answers0