PageSourceSearch

https://oss.zhidx.com/static/themes/zhidxcom/js/index.js?a=1

js zhidx.com collected 2026-10-01 12:20:04 UTC 2,549 bytes, 82 lines download raw bytes

1//轮播
2var topImgList = document.querySelector('.top-img-list');
3var imgWidth = document.querySelector('.top-img').offsetWidth;
4topImgList.innerHTML += topImgList.innerHTML;
5var intervalTime = 4000;
6var duration = 500;
7var index = 0;
8var timer = carousel();
9var list = document.querySelectorAll('.top-img-title-list li');
10if (list.length > 0) {
11    document.querySelectorAll('.top-img-title-list li')[0].style.display = 'block';
12    jQuery('.top-img-ico-list li').each(function(i, e) {
13        e.onclick = function() {
14            setSelect(i - 1);
15            index = i;
16            clearInterval(timer);
17            setImgListStyle(((index) * imgWidth), duration);
18            timer = carousel();
19        }
20    })
21}
22
23
24function carousel(){
25
26    timer = setInterval(function() {
27        setSelect(index);
28        setImgListStyle(((index + 1) * imgWidth), duration);
29        index ++;
30        if (index == 4) {
31            setTimeout(function() {
32                index = 0
33                setImgListStyle(0, 0);
34            }, duration)
35        }
36    }, intervalTime);
37    return timer;
38}
39
40function setImgListStyle(left, duration) {
41    topImgList.style.cssText = "width:"+imgWidth * 8 +"px;transform: translateX(-"+left+"px); transition: all "+duration+"ms;"
42}
43
44function setSelect(index) {
45    var ind = (index + 1) % 4
46    var list = document.querySelectorAll('.top-img-ico-list li');
47    var imgList = document.querySelectorAll('.top-img-title-list li');
48
49    if (list.length < 1 || imgList.length < 1) {
50        return;
51    } 
52    for (var i = 0; i < list.length; i ++) {
53        var e = list[i];
54        if (i == ind) {
55            imgList[i].style.display = "block";
56            e.className = 'img-ico-select';
57        } else {
58            imgList[i].style.display = "none";
59            e.className = '';
60        }
61    }
62}
63
64var cid = cid ? cid : 0;
65//获取快讯
66jQuery.get('https://wx.zhidx.com/zhidx/work/getNews?cid='+cid, function(rst) {
67    var data = JSON.parse(rst);
68    var htmlTemp = jQuery('#news-tmp').html();
69    var html = '';
70    data.result.forEach(function(e) {
71        html += htmlTemp.replace(/{{main_title}}/g, e.main_title).replace(/{{publish_time}}/, e.publish_time).replace(/{{id}}/, e.blogid);
72    });
73    // console.log(html);
74    jQuery('.news-list').get(0).innerHTML = html;
75});
76
77jQuery('.top-img-min>li').on('mousemove', function() {
78    jQuery(this).find('img').css('transform', 'scale(1.1)');
79})
80jQuery('.top-img-min>li').on('mouseout', function() {
81    jQuery(this).find('img').css('transform', 'scale(1)');
82})

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.