现在要实现这样了一个效果。在点击一个下载按钮时,遮罩整个页面。并在遮罩层上方显示一个加载图,在指定的时间10000ms后遮罩效果和加载图又自动隐藏。(本想做一个进度条与数据库读取同步的。但感觉麻烦,所以就设置了一个定值10000ms),下面是js,引用的thickbox.js,对它做了一点点修改。
疑问:我要实现的这样了一个效果。在firefox下设置断点,调试时能达到我要的要求。但断点一去。点击下载的时候。不再显示遮罩层效果。怀疑是不是setTimeout的用法不当。
var tb_pathToImage = "images/loadingAnimation.gif";
var t;// add sunqs
function tb_init(domChunk){
jQuery(domChunk).click(function(){
var t = this.title || this.name || null;
var a = this.href || this.alt;
var g = this.rel || false;
tb_show(t,a,g);
this.blur();
return false;
});
}
function tb_show(caption, url, imageGroup) {
try {
if (typeof document.body.style.maxHeight === "undefined") {//ie6
jQuery("body","html").css({height: "100%", width: "100%"});
jQuery("html").css("overflow","hidden");
if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
jQuery("body").append("
改为t=setTimeout("tb_remove()",10000);//add sunqs 10000ms auto disaplear
你测试一下是不是setTimeout的问题就好了嘛,先把setTimeout的那段代码注释掉,看能不能出来,如果能出来,就说明是setTimeout的问题
同学,你少加了“引号”