I am coding with jQuery and jQueryUI at the moment. I am using the jQuery Dialog Widget. (jQuery API - Dialog Widget)
I am opening a dialog and use a show-method for that, the code is something like this:
$("#dialog").dialog({
dialogClass: 'myclass',
height: 'auto',
width: 'auto',
modal: true,
resizable: false,
draggable: false,
buttons: [{ text: "Ok", click: function () { $(this).dialog("close"); } }],
show: { effect: "slide", duration: 1000, direction: "right", finish: function () { $(".myclass.ui-dialog").css("position", "fixed"); console.log("done after effect"); } },
position: { my: "right top", at: "right top", of: window },
});
The important part is the show:
there. All of it is working except the "finish" parameter. Is there any other way to add a function after this show effect is finished?
I just want to make my dialog fixed so that it stays on its position if you are scrolling. I tried to overwrite the css class and it works, but while the effect is running, the display is broken (displayed on the left instead of right) and just after it it is correct, so I wanted to try to add it after the effect.
So, is there a good way?