jQuery(document).ready(function () { /*头部搜索*/ if ($(window).width() < 748) { $('.searchBar a').click(function () { if ($(this).attr('id') != 'click') { $(this).attr('id', 'click'); $('.searchBar-m').show(); } else { $(this).removeAttr('id'); $('.searchBar-m').hide(); } }); } else { $('.searchBar a').click(function () { $('.searchBar-m').slideDown(); }); } $('.searchBar-m a').click(function () { $('.searchBar-m').hide(); }); /*弹出友链*/ $('.friendlink,.popup-link').hover( function () { $(this).parent().find('ul').show(); }, function () { $(this).parent().find('ul').hide(); } ); $('.bandwidth-item').click(function () { // 移除所有项的active_band类 $('.bandwidth-item').removeClass('active_band'); // 给当前点击的项添加active_band类 $(this).addClass('active_band'); // 获取当前项的索引 var index = $(this).index(); // 根据不同的索引替换视频和标题 var videoSrc = ''; var titleText = '视频/图像压缩10-100倍,节省90%传输带宽'; switch (index) { case 0: videoSrc = '/template/pc/skin/images/come_back_n.mp4'; titleText = '视频/图像压缩10-100倍,节省90%传输带宽'; // 修改标题文本 break; case 1: videoSrc = '/template/pc/skin/images/can_be_saved_n.mp4'; titleText = '视频/图像压缩10-100倍,节省90%存储成本'; // 修改标题文本 break; case 2: videoSrc = '/template/pc/skin/images/can_see_clearly_n.mp4'; titleText = '丰富的视频增强/还原技术,各种场景压缩后视频都看得清楚'; // 修改标题文本 break; } // 替换视频的src $('#bandvideo source').attr('src', videoSrc); // 重新加载视频并播放 $('#bandvideo')[0].load(); $('#bandvideo')[0].play(); // 更新标题文本 $('#handtitle').text(titleText); }); }); //登录注册tab function setTab(name, cursel, n) { for (i = 1; i <= n; i++) { var menu = document.getElementById(name + i); var con = document.getElementById('con_' + name + '_' + i); menu.className = i == cursel ? 'cur' : ''; con.style.display = i == cursel ? 'block' : 'none'; } }