PageSourceSearch

https://www.musclecarthailand.com/_upload/tpl/05/f3/1523/template1523/js/app.js

js musclecarthailand.com collected 2026-10-06 13:15:49 UTC 4,690 bytes, 152 lines download raw bytes

1/*
2*构建SDAPP
3*/
4SDAPP = (function(){
5	function App(options){
6		this.O = options;
7		this.J = jQuery;
8		this.init();
9	}
10	return App;
11})();
12
13SDAPP.prototype.init = function(){
14	this.client();
15	this.plugin();
16	this.renew();
17}
18
19/**
20 * getClient
21 */
22SDAPP.prototype.client = function(){
23	return {
24		"width":this.J(window).width(),
25		"height":this.J(window).height()
26	};
27}
28
29/**
30 * resize
31 */
32SDAPP.prototype.renew = function(){
33	var _this = this;
34	_this.J(window).resize(function(event) {
35		_this.client();
36		window.console&&console.log(_this.client().width,_this.client().height);
37	});
38}
39
40/**
41 * plugin
42 */
43SDAPP.prototype.plugin = function(){
44	var _this = this;
45	// focus
46	this.O['focus']&&this.J("[data-focus]").sudyfocus(this.O['focus']);
47
48	// menu
49	if(this.client().width > 999){
50		/*增加*/
51		this.J(".wp-navi .wp-menu li").each(function(){
52			_this.J(this).children(".menu-switch-arrow").appendTo(_this.J(this).children(".menu-link"));
53		});
54		this.J(".wp-navi").find("li").on("mouseenter",function(){
55			_this.J(this).addClass("hover");
56			_this.J(this).children("a").addClass("parent");
57			_this.J(this).children('.sub-menu').show();
58		}).on("mouseleave",function(){
59			_this.J(this).removeClass("hover");
60			_this.J(this).children("a").removeClass("parent");
61			_this.J(this).children('.sub-menu').hide();
62		});
63	}
64
65	var $aside = this.J("#wp-navi-aside");
66	if(this.O['menu']){
67		if(/slide/.test(this.O.menu['type'])){
68			this.J(".wp-navi").addClass('wp-navi-slide');
69			this.J(".navi-slide-head").on("click",function(){
70				_this.J(this).siblings().slideToggle(150);
71			});
72			this.J(".wp-navi").find("li").find(".menu-switch-arrow").on("click",function(){
73				_this.J(this).parent().children('.sub-menu').slideToggle(250)
74				.parent().siblings(".menu-item,.sub-item").children('.sub-menu').slideUp(250);
75			});
76		}
77		if(/aside/.test(this.O.menu['type'])){
78			var $menus = [];
79			this.J("[data-nav-aside]").clone().each(function(index, el){
80				var opt = _this.J.parseJSON(_this.J(el).attr("data-nav-aside"));
81				$menus[opt.index] = _this.J('<div class="navi-aside-head"><h3 class="navi-aside-title">'+opt.title+'</h3></div>').add(el);
82			});;
83
84			$.each($menus, function() {
85				_this.J(this).appendTo(".navi-aside-wrap");
86			});
87
88			this.J(".navi-aside-toggle").addClass('navi-aside-toggle-show').on("click",function(){
89				$aside.addClass('wp-navi-aside-active');
90				_this.J("html").css({marginTop:0});
91				_this.J("body").addClass('navi-aside-page').css({width:_this.client().width,height:_this.client().height})
92				.stop().animate({marginLeft:216}, 250);
93				_this.J(".aside-inner", $aside).addClass('aside-inner-show').stop().animate({left:0}, 250);
94			});
95			
96			this.J(".navi-aside-mask").on("click",function(event){
97				event.preventDefault();
98				_this.J("body").removeClass('navi-aside-page').stop().animate({marginLeft:0}, 250,function(){
99					_this.J("body").removeAttr('style');
100					$aside.removeClass('wp-navi-aside-active');
101					_this.J("html").removeAttr('style');
102				});
103				_this.J(".aside-inner", $aside).removeClass('aside-inner-show').stop().animate({left:-216}, 250);
104			});
105			/*增加*/
106			this.J(".menu-switch-arrow",".wp-navi-aside").each(function(){
107				console.log(_this.J(this).parent("a"));
108				_this.J(this).insertAfter(_this.J(this).parent("a"));
109			});
110			
111			this.J(".menu-switch-arrow",".wp-navi-aside").prev().on("click",function(){
112				_this.J(this).toggleClass('menu-open-arrow').siblings(".sub-menu").slideToggle(250);
113			});
114			this.J(".menu-switch-arrow",".wp-navi-aside").on("click",function(){
115				_this.J(this).toggleClass('menu-open-arrow').siblings(".sub-menu").slideToggle(250);
116			});
117		}
118	}
119
120	this.J(".col_menu_head").on("click",function(event){
121		event.preventDefault();
122		_this.J(".col_menu_con").slideToggle(150);
123	});
124
125	if(this.J(".wp_column").length<1){
126		this.J(".column-switch").hide();
127		this.J(".col_menu_head").unbind("click");
128	}
129
130	// small screen
131	if(this.client().width<768){
132		// jumphandle
133		this.J('<div id="jumphandle"><a id="gotop"></a><a id="gobot"></a></div>').appendTo('body');
134		this.J(window).scroll(function(event) {
135			/* Act on the event */
136			var scrolltop = _this.J(window).scrollTop();
137			if(scrolltop>200){
138				_this.J("#jumphandle").show();
139			}else{
140				_this.J("#jumphandle").hide();
141			}
142		});
143		this.J("#gotop").on("click",function(){
144			_this.J("body,html").stop().animate({scrollTop:0}, 500);
145		});
146		this.J("#gobot").on("click",function(){
147			_this.J("body,html").stop().animate({scrollTop:_this.J(document).height()}, 500);
148		});
149
150	}
151
152}

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.