Home >Web Front-end >JS Tutorial >jQuery table top bar fixed effect
This time I will bring you jQuerytablefixed effect of the top bar, what are the notes of the fixed effect of the top bar of the jQuery table, the following is a practical case , let’s take a look.
This kind of effect is not difficult, but it is indeed quite troublesome to achieve. I won’t go into details about the difficulty here. It’s just that I got a little more effect at once. Finally, I found the answer on a website I often visit.
The address of the original question: https://segmentfault.com/q/1010000000130774
Here is an introduction to the usage of this small plug-in. First, go to the famous 'same-sex' dating website github and download the code
I mainly use the ones in my red box, but you can also look at other people’s source codes. Here you only need to reference js, and then add the two
in the picture to the two tags table and thead. It's the words in the red box. Then it will be effective.
However, some people may not have any effect. Don’t panic. Press F12 and look at the error message. My error message is that there is a .size that does not define this method. At this time, replace this js. Just one click:
Then you can achieve the effect! Some people may find it annoying. These are all pictures. I don’t think you can copy them directly, but I think there is a gap between reading a lot of things yourself and actually writing them out. I hope everyone I can really write about it, but I think about what I made last night and I don’t want to open my eyes anymore. I don’t have time to write anymore, so I might as well type up my pictures so that everyone can copy:
Class in table class="table-fixed-header"
The class in thead class='header'
js to be added: $('.table-fixed-header').fixedHeader();
I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!
Recommended reading:
jQuery operation anchor point dynamic displacement
.Active dynamic use to achieve navigation effect
The above is the detailed content of jQuery table top bar fixed effect. For more information, please follow other related articles on the PHP Chinese website!