0
|
luojian0323Lv7资深互助发布于2023-10-23 10:56(编辑于 2023-10-23 13:35)
|
试试把延时函数setTimeout改成定时函数 setInterval setInterval(function() {
var $report = $("div[widgetname=REPORT4]");//REPORT4为报表块名
//获取对应report的div元素
var $scroll = $report.find("#frozen-center");
//获取对应report的div元素的滚动块元素,冻结为#frozen-center,未冻结且未安装自定义滚动条插件为.reportContent,未冻结且安装了自定义滚动条插件为.scrollDiv
var flag = window.flag0;
//设置全局变量flag,每个报表块需保证各不相同
$report.find("#frozen-center").css('overflow-x', 'hidden');
$report.find("#frozen-center").css('overflow-y', 'hidden');
$report.find("#frozen-north").css('overflow-x', 'hidden');
$report.find("#frozen-north").css('overflow-y', 'hidden');
//冻结情况下隐藏滚动条
$report.find(".reportContent").css('overflow-y', 'hidden');
$report.find(".reportContent").css('overflow-x', 'hidden');
//非冻结情况下隐藏滚动条
flag = true;
//定义全局参数flag,用来控制滚动的暂停和继续
$scroll.mouseover(function() {
flag = false;
})
//鼠标悬浮,滚动停止
$scroll.mouseleave(function() {
flag = true;
})
//鼠标离开,继续滚动
var old = -1;
}, 1000);
|
-
wanglina56(提问者)
- 能发个成品js我改改吗?
-
wanglina56(提问者)
- 这样的化鼠标放上面就没有滚动功能了吧
setInterval(function() {
var $report = $(\"div[widgetname=REPORT4]\");//REPORT4为报表块名 //获取对应report的div元素
var $scroll = $report.find(\"#frozen-center\"); //获取对应report的div元素的滚动块元素,冻结为#frozen-center,未冻结且未安装自定义滚动条插件为.reportContent,未冻结且安装了自定义滚动条插件为.scrollDiv
var flag = window.flag0; //设置全局变量flag,每个报表块需保证各不相同
$report.find(\"#frozen-center\").css(\'overflow-x\', \'hidden\');
$report.find(\"#frozen-center\").css(\'overflow-y\', \'hidden\');
$report.find(\"#frozen-north\").css(\'overflow-x\', \'hidden\');
$report.find(\"#frozen-north\").css(\'overflow-y\', \'hidden\'); //冻结情况下隐藏滚动条
$report.find(\".reportContent\").css(\'overflow-y\', \'hidden\');
$report.find(\".reportContent\").css(\'overflow-x\', \'hidden\'); //非冻结情况下隐藏滚动条
flag = true; //定义全局参数flag,用来控制滚动的暂停和继续
$scroll.mouseover(function() { flag = false; }) //鼠标悬浮,滚动停止
$scroll.mouseleave(function() { flag = true; }) //鼠标离开,继续滚动
var old = -1; }, 1000);
|
|