var index = 0;
var preText = '';
var nextText = '';
$(function(){
$('.pretext1').text('无');
$('.nexttext1').text($('.bannerul>li').eq(index+1).find('.zhankong-title').text());
$('.pre').click(function(){
if(index == 0) return;
index--;
SetHeadTitle(index);
SetLiVisible(index);
});
$('.next').click(function(){
debugger;
if(index == $('.bannerul>li').length-1) return;
index++;
SetHeadTitle(index);
SetLiVisible(index);
});
})
function SetHeadTitle(index)
{
if(index ==0)
{
preText = '无';
nextText = $('.bannerul>li').eq(index+1).find('.zhankong-title').text();
}
else if(index == $('.bannerul>li').length-1)
{
preText = $('.bannerul>li').eq(index-1).find('.zhankong-title').text();
nextText = '无';
}
else
{
preText = $('.bannerul>li').eq(index-1).find('.zhankong-title').text();
nextText = $('.bannerul>li').eq(index+1).find('.zhankong-title').text();
}
$('.pretext1').text(preText);
$('.nexttext1').text(nextText);
}
function SetLiVisible(index)
{
$('.bannerul>li').each(function(i,item){
$(this).removeClass('bannerliYes');
$(this).addClass('bannerliNo');
});
$('.bannerul>li').eq(index).removeClass('bannerliNo');
$('.bannerul>li').eq(index).addClass('bannerliYes');
}
(adsbygoogle = window.adsbygoogle || []).push({});
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有