1
私は2つのjQueryアイドルタイマーを1つ下に持ち、もう1つは同様のコードでタイムアウト値が最初のものよりも高くなっています。私は2番目のタイムアウト値をコメントしました。 2つのスクリプトは同じxhtmlページで実行されています。最初のモーダル(タイムアウトの低いもの)がポップアップすると、私はそれを閉じることができず、また "myTimeout"値の後のリダイレクトページにも行きません。アイドルタイマーが動作しない
(function($){
var timer;
//var timeout = 600000;
//var myTimeOut = 120000;
var timeout = 120000;
var myTimeOut = 60000;
$(document).bind("idle.idleTimer", function(){
$("#popup-modal").dialog({
modal: true,
autoOpen: true,
width: 574,
resizable : false,
draggable:false,
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); $(".ui-dialog-print").hide(); $(".ui-icon").hide(); },
show: {effect: 'fade'}
});
timer = window.setTimeout(function()
{ window.location.href = "redirectpage.xhtml";},myTimeOut);
});
$(document).bind("active.idleTimer", function(){
timeout = 120000;
window.clearTimeout(timer);
});
$.idleTimer(timeout);
})(jQuery);