From 7578c3ff65329b2269f099475eb687e963efac1c Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期二, 27 二月 2024 17:13:29 +0800 Subject: [PATCH] 地图3D模型、折线图和表格三者点击联动效果 --- lib/tableutil.js | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/tableutil.js b/lib/tableutil.js index 009c9b6..111d933 100644 --- a/lib/tableutil.js +++ b/lib/tableutil.js @@ -163,7 +163,7 @@ }); trC.on('click', function () { that.changeRowColor($(this).attr('index')); - Table._onClick(e, i); + Table._onClick(e, i + (that._curPage - 1) * that._perPage); }); if (this._onRow != undefined) { @@ -378,7 +378,7 @@ }, changeRowColor(thisIndex) { - const index = thisIndex % this._perPage + const index = thisIndex % this._perPage; if (this._lastSelectIndex != -1) { $(`#row-${this._lastSelectIndex}`).css('background-color', ''); } @@ -386,9 +386,12 @@ const row = $(`#row-${index}`); row.css('background-color', 'var(--select_color)'); var tbody = $(this._table.find('tbody')[0]); - tbody.animate({ - scrollTop: row.outerHeight() * index - 350 + 'px', - }, 500); + tbody.animate( + { + scrollTop: row.outerHeight() * index - 350 + 'px', + }, + 500 + ); // tbody.scrollTop(0, 100); // this._table.scrollTop = 100 }, -- Gitblit v1.9.3