表单中报表块的跑马灯每次刷新后,隐藏滚动条就会失效,出现滚动条。 5月13日,报表块使用官方JS跑马灯效果+定时刷新控件,刷新后依然出现滚动条 各位看看问题出在哪里?求指导。 JS如下, var supplierNumber = this.options.form.getWidgetByName("supplierNumber").getValue() var firstSupplierNumber = parseInt(supplierNumber); setTimeout(function() { //隐藏报表块report0_c的滚动条(此报表块名为report0_c,根据具体情况修改) $("div[widgetname=REPORT0]").find(".frozen-north")[0].style.overflow = "hidden"; $("div[widgetname=REPORT0]").find(".frozen-center")[0].style.overflow = "hidden"; }, 1000);
window.flag = true; //鼠标悬停,滚动停止 setTimeout(function() {
var old = -1; var interval = setInterval(function() { if(window.flag) { currentpos = $("div[widgetname=REPORT0]").find(".frozen-center")[0].scrollTop; if(currentpos == old) { $("div[widgetname=REPORT0]").find(".frozen-center")[0].scrollTop = 0; } else { old = currentpos; //以25ms的速度每次滚动1PX $("div[widgetname=REPORT0]").find(".frozen-center")[0].scrollTop = currentpos + 1; } } }, 25); }, 1000); var form = this.options.form; setInterval(function() { form.getWidgetByName('REPORT0').gotoPage(1,"{}",true); $("div[widgetname=REPORT0]").find(".frozen-north")[0].style.overflow = "hidden"; $("div[widgetname=REPORT0]").find(".frozen-center")[0].style.overflow = "hidden"; var lastSupplierNumber = parseInt(_g().options.form.getWidgetByName("report0").element.find("td[id^=A1-]").text()); if (lastSupplierNumber != firstSupplierNumber) { location.reload(); } }, 10000); //刷新报表块report0 10s刷新一次 -------------------------------------------------------------5.13 var supplierNumber = this.options.form.getWidgetByName("supplierNumber").getValue() var firstSupplierNumber = parseInt(supplierNumber); setTimeout(function() { //隐藏报表块report0_c的滚动条(此报表块名为report0_c,根据具体情况修改) $("div[widgetname=REPORT0]").find(".frozen-north")[0].style.overflow = "hidden"; $("div[widgetname=REPORT0]").find(".frozen-center")[0].style.overflow = "hidden"; console.log(1) }, 1000);
window.flag = true; //鼠标悬停,滚动停止 setTimeout(function() {
var old = -1; var interval = setInterval(function() { if(window.flag) { currentpos = $("div[widgetname=REPORT0]").find(".frozen-center")[0].scrollTop; if(currentpos == old) { console.log(2) $("div[widgetname=REPORT0]").find(".frozen-center")[0].scrollTop = 0; } else { old = currentpos; //以25ms的速度每次滚动1.5PX $("div[widgetname=REPORT0]").find(".frozen-center")[0].scrollTop = currentpos + 1; } } }, 25); }, 1000); var form = this.options.form; setInterval(function() { setTimeout(function() { $("div[widgetname=REPORT0]").find(".frozen-north")[0].style.overflow = "hidden"; $("div[widgetname=REPORT0]").find(".frozen-center")[0].style.overflow = "hidden"; form.getWidgetByName('REPORT0').gotoPage(1,"{}",true); console.log(3) }, 50); var lastSupplierNumber = parseInt(_g().options.form.getWidgetByName("report0").element.find("td[id^=A1-]").text()); if (lastSupplierNumber != firstSupplierNumber) { console.log(4) location.reload(); } }, 10000); //刷新报表块report0 5s刷新一次 |