公共部分样式修改及table表头固定
This commit is contained in:
@@ -103,7 +103,6 @@ export class MainComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
// console.log($)
|
||||
this.changeDetectorRef.detach();
|
||||
/* 获取显示列 */
|
||||
this.httpCilent.get('/assets/mock-data/airline-col_code.json').subscribe(
|
||||
@@ -195,6 +194,16 @@ export class MainComponent implements OnInit {
|
||||
this.doSequence(this.combined_data);
|
||||
}
|
||||
)
|
||||
|
||||
/**
|
||||
* 固定表头
|
||||
*/
|
||||
var tableCont = document.querySelector('#table-container')
|
||||
function scrollHandle (){
|
||||
var scrollTop = this.scrollTop;
|
||||
this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)';
|
||||
}
|
||||
tableCont.addEventListener('scroll',scrollHandle)
|
||||
}
|
||||
|
||||
|
||||
@@ -439,7 +448,7 @@ export class MainComponent implements OnInit {
|
||||
|
||||
let tr = $(".selected");
|
||||
let objTr = tr[0];
|
||||
$("#table-container").animate({ scrollTop: objTr.offsetTop }, "slow");
|
||||
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user