Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

浏览器页面查找功能(按Ctrl + F)对插件的影响 #1

Open
wingmeng opened this issue Sep 26, 2017 · 1 comment
Open

浏览器页面查找功能(按Ctrl + F)对插件的影响 #1

wingmeng opened this issue Sep 26, 2017 · 1 comment

Comments

@wingmeng
Copy link
Owner

wingmeng commented Sep 26, 2017

在浏览器页面按下 Ctrl + F 会调出页面查找功能,当用来检索应用 fixedThead 插件的表格内容时,会导致如下问题:

  1. 造成页面搜索的关键词统计数量偏误(由于复制原表格作为表头和表列导致内容重复了);
  2. 匹配的 table 中的关键词会自动定位显示在可视区,造成 table 遮挡区域位移,从而布局被破坏(主要是国内双核浏览器)。

想到了使用 visibility: hidden 来解决,但成本太高,会严重拖慢列固定时的性能,目前没啥好办法,苦恼中……

@mstephenn
Copy link

   function buildHTML_head(configs) {
	var wrap = configs.wrapper.find('div.fixed-thead-head');
	var headTable = cloneTable(configs.table, 'head'),
			$tbody = $("tbody", headTable).empty(); // removes body content from cloned table

	if (wrap.length == 0) {
		wrap = $('<div class="fixed-thead-head"></div>');			
		configs.bodyWrap.before(wrap.append(headTable));
	} else {
		wrap.empty().append(headTable);  // empty()一下释放内存
	}
	return wrap;
   }

Changing the function buildHTML_head to the above format cleared the issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants