开发者

Jquery Dialog..What am I doing wrong?

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',
       开发者_Go百科 opacity: 0.5
    }
});

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

}


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);
    });


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜