0

我在 jquery 移动应用程序中使用 simpledialog。在正常浏览器宽度下运行时它工作正常。但是,当我将屏幕宽度减小到小于 250 像素(apprx。)(屏幕宽度匹配移动设备)时,URL 开始在当前 URL 中附加 #&ui-state=dialog。问题也与重定向有关。我的一个按钮链接到其他页面。当我单击该按钮时,它会重定向到指定页面并返回当前页面。但如果我再次这样做,就不会有任何问题。谁能帮我解决这个问题?

我的简单对话框代码如下:

$('#create_invoice').append('<div id="temp_div_popup" style="width:80px;position:absolute;top:0px;left:0px;"></div>');
$('#temp_div_popup').simpledialog({
    'buttons':{
        'Edit':{
            click:function () {
                operation = 'edit_exist';
                if (type == 'item') {
                    $.mobile.changePage('add_item.html',{
                        transition : 'none',
                        allowSamePageTransition : true
                    });
                }
                else if (type == 'task') {
                    $.mobile.changePage('add_task.html',{
                        transition : 'none',
                        allowSamePageTransition : true
                    });
                }
                $('#temp_div_popup').remove();
            }
        },
        'Delete':{
            click:function () {
                deleteItemOrTask(type);
                $('#temp_div_popup').remove();
            }
        },

        'Cancel':{
            click:function () {
                $('#temp_div_popup').remove();
            },
            icon:"delete",
            theme:"c"
        }
    },
    'height' :function(){
        return '55px;'
    },
    'width' : function(){
        return '140px';
    }
});
4

1 回答 1

1

这个问题通常只在较小的视图中出现,例如在手机中。可以通过将浏览器调整为更小的窗口来模拟它。我通过删除这个插件并添加我自己的自定义对话框窗口解决了这个问题。:)

于 2012-06-29T17:26:32.770 回答