PageSourceSearch

https://well-tech-china.com/qh1/accordion.js

js well-tech-china.com collected 2026-10-05 18:54:43 UTC 2,526 bytes, 83 lines download raw bytes

1//手风琴
2var accor=function(acc,wd,speed,isOpen,isClickOpen){
3	var $accor=acc;
4	var accorImg=$accor.find('.img_ar img');
5	var accorSet=function(){
6		var wdC;
7		var $accorLi=$accor.find('li');
8		var leng=$accorLi.length;
9		var wdParent;
10		var liOWid;
11		var patt1 = new RegExp(/^\d+%$/);
12		var isPatt=patt1.test(wd);
13		var perc=0;
14		if(isPatt){
15			perc=wd.replace("%","");
16		}
17		var widSetInit=function(){
18		  wdParent=$accor.width();
19		  if(isPatt){
20			wd=parseInt(wdParent) * perc/100;
21		  }
22		  if(wdParent*0.7>wd){
23			  wdC=wd;
24		  }else{
25			  wdC=wdParent*0.7;
26		  }
27		  $accorLi.find('.img_ar').css({'width':wdC});
28		  liOWid=(wdParent-wdC-2)/(leng-1);
29		  $accorLi.css({'width':wdParent/leng});
30		  if(isOpen){
31			 $accorLi.eq(0).addClass('cur').stop(true).animate({width:wdC},speed).siblings().removeClass('cur').stop(true).animate({width:liOWid},speed); 
32		  }
33		  setTimeout(function () {
34			  $accor.css({'height':$accor.height()});
35			  $accorLi.find('.img_ar').css({'height':$accor.height()});
36		  }, 200);
37		}
38		widSetInit();
39		$(window).resize(function(){
40		  $accor.css({'height':'auto'});
41		  $accorLi.find('.img_ar').css({'height':'auto'});
42		  widSetInit();
43		});
44		if(isClickOpen){
45			$accor.addClass('accorClick');
46			$accorLi.children('a').remove();
47			$accorLi.on('click',function(){
48			   var _index = $(this).index();
49			   $(this).addClass('cur').stop(true).animate({width:wdC},speed).siblings().removeClass('cur').stop(true).animate({width:liOWid},speed);
50			})
51		}else{
52			$accor.addClass('accorNoClick');
53			$accorLi.hover(function(){
54			 var _index = $(this).index();
55			 $(this).addClass('cur').stop(true).animate({width:wdC},speed).siblings().removeClass('cur').stop(true).animate({width:liOWid},speed);
56			},function(){
57			  if(!isOpen){
58				  $accorLi.stop(true).animate({'width':wdParent/leng},speed).removeClass('cur');
59			  }
60			})
61		}
62	}
63	// 判断图片加载的函数
64    var accrIsImgLoad = function (_obj) {
65        if (_obj.height() === 0) {
66            var t_img;
67            t_img = setInterval(function () {
68                clearInterval(t_img);
69                accrIsImgLoad(_obj);
70            }, 10);
71        } else {
72            accorSet(_obj);
73        }
74    }
75
76    for (var i = 0; i < accorImg.length; i++) {
77        var accrImg = $(accorImg[i]);
78        var newImg = new Image;
79        newImg.index = i;
80        accrIsImgLoad($(accorImg[i]));
81        newImg.src = accrImg.attr('src');
82    }
83}

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.