有没有一种方法,我可以复制alert()函数做什么,没有弹出?这看起来可能很疯狂,但有一个很好的原因。创建alert()方法没有显示 - javascript
EDIT
这是我的代码:
var navActive;
var pageID;
var maxNav;
var popWidth = $(window).width();
var popHeight = $(window).height();
function thread_start(callback) {
setTimeout(callback, 1);
return true;
}
(function($){
$.fn.foneySlide = function (options) {
$(window).resize(function(){
popWidth = $(window).width() - 40;
popHeight = $(window).height() - 40;
})
opt = $.extend ({ popOnTransition : true }, options);
// firstly give all navigation items a position reference for continous slide
$('[data-role=page]').each(function(i){
$(this).attr('navpos', i);
if(typeof $('[data-role=page]')[i+1] == 'undefined') {
maxNav = i;
}
});
// get the current active page and the default navigation position
pageID = $('.ui-page-active').attr('id');
navActive = $('#' + pageID).attr('navpos');
// change page on swipe left
$('body').bind('swipeleft', function(e){
if(navActive == maxNav) {
navActive = 0;
alert();
thread_start("$.mobile.changePage($('[navpos=0]'), 'slide', false, true)");
}else{
navActive = Number(navActive + 1);
alert();
thread_start("$.mobile.changePage($('[navpos=' + navActive + ']'), 'slide', false, true)");
}
});
// change page on swipe right
$('body').bind('swiperight', function(e){
if(navActive == 0) {
navActive = maxNav;
alert();
thread_start("$.mobile.changePage($('[navpos=' + navActive + ']'), 'slide', true, true)");
}else{
navActive = Number(navActive - 1);
alert();
thread_start("$.mobile.changePage($('[navpos=' + navActive + ']'), 'slide', true, true)");
}
});
}
})(jQuery的);
删除警报并开始冻结。
没有弹出什么是警报? – ErikPerik 2011-06-09 11:29:47
警报功能做什么,没有弹出? – Gareth 2011-06-09 11:29:55
假设所有警报都会显示一个弹出窗口,我想知道如果不想弹出窗口,预期的结果是什么。这就像是远离夏日假期的阳光。你留下来,没有:-) – 2011-06-09 11:31:14