<script>
var navulsize = $('.navul li').size();
var navulwidth = $('.navul li').width();
var allwidth = navulwidth*navulsize;
$('.navul').width(allwidth);
$('.navul li').click(function(){
var index = $(this).index();//获取当前点击的li是ul中的第几个
var indexur = '#' + index;
var indexurl = $(this).children('a').attr('href');
var hehref = indexurl + indexur;
var data = $(this).attr('data');
$(this).children('a').attr('href',hehref);
$(data).show().siblings('.gengxinbox').hide();
$(this).addClass('liactive').siblings('li').removeClass('liactive');
var endhref = $(this).children('a').attr('href');
var parsenum = parseInt(endhref.replace(/[^0-9]/ig,""));//jq提取字符串中的数字
alert(endhref);
});
</script>