2012-06-18 133 views
0

我在jquery mobile app中使用simpledialog。在正常浏览器宽度下运行时,它工作正常。 但是,当我减少屏幕宽度小于250px(apprx。)(屏幕宽度匹配手机)URL开始追加#& ui-state =对话框与当前的URL。问题在于重定向。我的其中一个按钮链接到其他页面。当我点击该按钮时,它会重定向到指定页面并返回到当前页面。但是如果我再次做同样的事情,那么不会有任何问题。谁能帮我解决这个问题吗?jquery手机导航问题

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

$('#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'; 
    } 
}); 

回答

1

这个问题一般出现在较小的意见只喜欢在手机上。可以通过调整浏览器的大小来模拟它。我通过删除此插件并添加了我自己的自定义对话框窗口来解决该问题。 :)