| ¶Ô±ÈÐÂÎļþ |
| | |
| | | $(document).ready(function() { |
| | | // 设置å
Œ
±å¯¼èªæ |
| | | // $("#header").load("./components/nav.html"); |
| | | // 设置å
Œ
±åºé¨ |
| | | $("#footer").load("./components/footer.html"); |
| | | |
| | | // å½é¡µé¢æ»å¨å°ä¸å®è·ç¦»æ¶æ¾ç¤ºè¿åé¡¶é¨æé® |
| | | $('#back-to-top').fadeOut(); |
| | | $(window).scroll(function() { |
| | | if ($(this).scrollTop() > 100) { // è¿éå¯ä»¥æ ¹æ®éè¦è°æ´æ°å¼ |
| | | $('#back-to-top').fadeIn(); // æ¾ç¤ºæé® |
| | | } else { |
| | | $('#back-to-top').fadeOut(); // éèæé® |
| | | } |
| | | }); |
| | | |
| | | // ç¹å»æé®æ¶ï¼é¡µé¢å¹³æ»æ»å¨å°é¡¶é¨ |
| | | $('#back-to-top').click(function(event) { |
| | | event.preventDefault(); // 黿¢é¾æ¥çé»è®¤è¡ä¸º |
| | | $('html, body').animate({scrollTop: 0}, 800); // 页é¢å¹³æ»æ»å¨å°é¡¶é¨ï¼800毫ç§å®ææ»å¨ |
| | | }); |
| | | |
| | | $(".index-a-c-item").click(function () { |
| | | // console.log($(this).siblings()) |
| | | $(this).siblings().each(function () { |
| | | let name = $(this).attr('name') |
| | | if (name === 'èµäº§ç®¡ç') { |
| | | $(this).children().first().attr('src', './assets/icon/yunwei_ic_zichan@2x.png') |
| | | } else if (name === 'å·¡æ£è¿ç»´') { |
| | | $(this).children().first().attr('src', './assets/icon/yunwei_ic_xunjian@2x.png') |
| | | } else if (name === 'ä»å¨ç®¡ç') { |
| | | $(this).children().first().attr('src', './assets/icon/yunwei_ic_cangchu@2x.png') |
| | | } else if (name === 'åæ·ç®¡ç') { |
| | | $(this).children().first().attr('src', './assets/icon/yunwei_ic_shanghu@2x.png') |
| | | } |
| | | $(this).css('background', '#ffffff') |
| | | $(this) |
| | | .children() |
| | | .last() |
| | | .children() |
| | | .css('color', '#191B1F') |
| | | }) |
| | | if ($(this).attr('name') === 'èµäº§ç®¡ç') { |
| | | $(this) |
| | | .css('background', '#FF7900') |
| | | .children() |
| | | .first() |
| | | .attr('src', './assets/icon/yunwei_ic_zichan_sel@2x.png') |
| | | } else if ($(this).attr('name') === 'å·¡æ£è¿ç»´') { |
| | | $(this) |
| | | .css('background', '#FF7900') |
| | | .children() |
| | | .first() |
| | | .attr('src', './assets/icon/yunwei_ic_xunjian_sel@2x.png') |
| | | } else if ($(this).attr('name') === 'ä»å¨ç®¡ç') { |
| | | $(this) |
| | | .css('background', '#FF7900') |
| | | .children() |
| | | .first() |
| | | .attr('src', './assets/icon/yunwei_ic_cangchu_sel@2x.png') |
| | | } else if ($(this).attr('name') === 'åæ·ç®¡ç') { |
| | | $(this) |
| | | .css('background', '#FF7900') |
| | | .children() |
| | | .first() |
| | | .attr('src', './assets/icon/yunwei_ic_shanghu_sel@2x.png') |
| | | } |
| | | $(this) |
| | | .children() |
| | | .last() |
| | | .children() |
| | | .css('color', '#FFFFFF') |
| | | }) |
| | | }); |