PageSourceSearch

https://www.myhealthytech.com/js/main.js

js myhealthytech.com collected 2026-10-08 11:17:35 UTC 3,163 bytes, 95 lines download raw bytes

1$(document).ready(function () {
2	var banOffTop = $(".navbar").offset().top; //获取到距离顶部的垂直距离
3	var scTop = 0; //初始化垂直滚动的距离
4	$(document).scroll(function() {
5		scTop = $(this).scrollTop(); //获取到滚动条拉动的距离
6		//console.log(scTop);//查看滚动时,垂直方向上,滚动条滚动的距离
7		if (scTop > banOffTop) {
8			//核心部分:当滚动条拉动的距离大于等于导航栏距离顶部的距离时,添加指定的样式
9			$(".navbar").addClass("fixed-top");
10		} else {
11			$(".navbar").removeClass("fixed-top");
12		}
13	});
14	
15	if ( $("#swiper-box1").length > 0 ) {
16		var swiper1 = new Swiper('#swiper-box1', {
17			loop: true,
18			slidesPerView: 'auto',
19			navigation: {
20				nextEl: '.swiper-button-next',
21				prevEl: '.swiper-button-prev',
22			},
23		});
24		//鼠标移出隐藏按钮,移入显示按钮
25		swiper1.el.onmouseover=function(){
26		  swiper1.navigation.$nextEl.removeClass('hide');
27		  swiper1.navigation.$prevEl.removeClass('hide');
28		}
29		swiper1.el.onmouseout=function(){
30		  swiper1.navigation.$nextEl.addClass('hide');
31		  swiper1.navigation.$prevEl.addClass('hide');
32		}
33	}
34	
35	if ( $("#swiper-box2").length > 0 ) {	
36		var swiper2 = new Swiper('#swiper-box2', {
37			loop: true,
38			slidesPerView: 'auto',
39			navigation: {
40				nextEl: '.swiper-button-next',
41				prevEl: '.swiper-button-prev',
42			},
43		});
44		//鼠标移出隐藏按钮,移入显示按钮
45		swiper2.el.onmouseover=function(){
46		  swiper2.navigation.$nextEl.removeClass('hide');
47		  swiper2.navigation.$prevEl.removeClass('hide');
48		}
49		swiper2.el.onmouseout=function(){
50		  swiper2.navigation.$nextEl.addClass('hide');
51		  swiper2.navigation.$prevEl.addClass('hide');
52		}
53	}
54	
55	if ( $("#swiper-box3").length > 0 ) {
56		var swiper3 = new Swiper('#swiper-box3', {
57			loop: true,
58			slidesPerView: 'auto',
59			navigation: {
60				nextEl: '.swiper-button-next',
61				prevEl: '.swiper-button-prev',
62			},
63		});
64		//鼠标移出隐藏按钮,移入显示按钮
65		swiper3.el.onmouseover=function(){
66		  swiper3.navigation.$nextEl.removeClass('hide');
67		  swiper3.navigation.$prevEl.removeClass('hide');
68		}
69		swiper3.el.onmouseout=function(){
70		  swiper3.navigation.$nextEl.addClass('hide');
71		  swiper3.navigation.$prevEl.addClass('hide');
72		}
73	}
74	
75	if ( $("#swiper-box5").length > 0 ) {
76		var swiper5 = new Swiper('#swiper-box5', {
77			loop: true,
78			slidesPerView: 'auto',
79			navigation: {
80				nextEl: '.swiper-button-next',
81				prevEl: '.swiper-button-prev',
82			},
83		});
84		//鼠标移出隐藏按钮,移入显示按钮
85		swiper5.el.onmouseover=function(){
86		  swiper5.navigation.$nextEl.removeClass('hide');
87		  swiper5.navigation.$prevEl.removeClass('hide');
88		}
89		swiper5.el.onmouseout=function(){
90		  swiper5.navigation.$nextEl.addClass('hide');
91		  swiper5.navigation.$prevEl.addClass('hide');
92		}
93	}
94});
95function fc_setActive(category){category = category||'首頁';jQuery('ul.navbar-nav li').each(function(k,v){jQuery(this).removeClass('active');});jQuery('ul.navbar-nav li[data-active="'+category+'"]').addClass('active');}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.