index-list.js 602 B

123456789101112131415161718192021222324
  1. let over = document.querySelector('.infoContent .tab-content').offsetHeight+100;
  2. window.addEventListener('scroll', fixedOnOver);
  3. const navCollapse = document.querySelector('#nav-collapse');
  4. function fixedOnOver() {
  5. if(window.pageYOffset >= over){
  6. navCollapse.classList.add('sticky');
  7. } else {
  8. navCollapse.classList.remove('sticky');
  9. }
  10. }
  11. checkTab()
  12. $('.infoContent .nav-item-link').click(checkTab);
  13. function checkTab() {
  14. if($('#pills-intro-tab').hasClass('active')) {
  15. $('.likeSee').attr('hidden', false)
  16. } else {
  17. $('.likeSee').attr('hidden', true)
  18. }
  19. }