0
votes

I am not sure what I am doing wrong. The dialog box comes but it does not follow any of the settings I specified.

function voteToday(id,userid){

$(".pleaseLogin").dialog({
    autoOpen:false,
    bgiframe: true,
    resizable: false,
    width:200,
    height:75,
    modal: true,
    overlay: {
        backgroundColor: '#000',
        opacity: 0.5
    }
});

$(".pleaseLogin").dialog('open');

}
2
Where did you get this .dialog() from?Harmen
It's better to save to reference to the element, in stead of getting it twice.Ikke

2 Answers

0
votes

You generate two different dialogs, one doesn't open but has options, one does open but has no options.

If you give more information where you got this dialog from, I could answer how to fix it.

EDIT

I was wrong, but found out that this code works fine. The only option that doesn't seem to work is autoOpen: false, but you open the box after you give that option.

    function voteToday(id,userid){
        $(".pleaseLogin").dialog('open');
    }

    $(document).ready(function(){
        $(".pleaseLogin").dialog({
            autoOpen: false,
            bgiframe: true,
            resizable: false,
            width:500,
            height:75,
            modal: true,
            overlay: {
                backgroundColor: '#000',
                opacity: 0.5
            }
        });
        $('.something').click(voteToday);
    });
0
votes

why not use the autoOpen: true setting? seems like the problem stems from calling .dialog() twice. You'll want to create the dialog when the DOM is ready, and then simply call the open method on it within your voteToday function.