1
part1
content1,content1
2
part2
content2,content2
2-1
part2-1
content2-1,content2-1
2-2
part2-2
content2-2,content2-2
3
part3
content,content
4
part4
content,content
5
part5
content5,content5
6
part6
content6,content6
7
part7
content7,content7
8
part8
content8,content8
9
part9
content9,content9
10
part10
content10,content10
11
part11
content11,content11
12
part12
content12,content12
13
part13
content13,content13
14
part14
content14,content14
15
part15
content15,content15
bottom
var SlideInnerHeight = $('#sideCatalog-catalog dl').height();
var SlideOutHeight = $('#sideCatalog-catalog').height();
varenableTop=slideInnerHeight-slideOutHeight;
var 步驟 = 50;
//點選向上的按鈕
$('#sideCatalog-down').bind('點選', function () {
if ($(this).hasClass('sideCatalog-down-enable')) {
if ((enableTop - Math.abs(parseInt($('#sideCatalog-catalog dl').css('top')))) > 步驟) {
$('#sideCatalog-catalog dl').stop().animate({'top': '-=' 步驟}, 'fast');
$('#sideCatalog-up').removeClass('sideCatalog-up-disable').addClass('sideCatalog-up-enable');
} 其他 {
$('#sideCatalog-catalog dl').stop().animate({'top': -enableTop}, 'fast');
$(this).removeClass('sideCatalog-down-enable').addClass('sideCatalog-down-disable');
}
} 其他 {
回復錯誤;
}
})
//點選下方的按鈕
$('#sideCatalog-up').bind('點選', function () {
if ($(this).hasClass('sideCatalog-up-enable')) {
if (Math.abs(parseInt($('#sideCatalog-catalog dl').css('top')) > 步驟) {
$('#sideCatalog-catalog dl').stop().animate({'top': ' =' 步驟}, 'fast');
$('#sideCatalog-down').removeClass('sideCatalog-down-disable').addClass('sideCatalog-down-enable');
} 其他 {
$('#sideCatalog-catalog dl').stop().animate({'top': '0'}, 'fast');
$(this).removeClass('sideCatalog-up-enable').addClass('sideCatalog-up-disable');
}
} 其他 {
回復錯誤;
}
})
//點選導覽中的各目錄
$('#sideCatalog-catalog dl').delegate('dd', 'click', function (e) {
var index = $(this).index();
scrollSlide($(this), 索引);
var ddId = $(this).find('a').stop().attr('href').substring(1);
var windowTop = $('a[name="' ddId '"]').offset().top;
$('body,html').animate({scrollTop: windowTop}, 'fast');
$(this).addClass('heightlight').siblings('dd').removeClass('heightlight');
})
//捲動頁面,即捲軸捲動
$(document).scroll(function () {
var len = $('.headline-1').length;
for (var i=len-1; i>=0; i--) {
if ($(this).scrollTop() >= $('.headline-1').eq(i).offset().top - $('.headline-1').eq(i).height( )) {
var index = i;
$('#sideCatalog-catalog dl dd').eq(index).addClass('heightlight').siblings('dd').removeClass('heightlight');
scrollSlide($('#sideCatalog-catalog dl dd').eq(index), index);
return 稱為;
} else {
$('#sideCatalog-catalog dl dd').eq(0).addClass('heightlight').siblings('dd').removeClass('heightlight');
}
}
})
//導航的捲動,以及向上,向下按鈕的顯示隱藏
function scrollSlide(that, index){
if (index
$('#sideCatalog-catalog dl').stop().animate({'top': '0'}, 'fast');
$('#sideCatalog-down').removeClass('sideCatalog-down-disable').addClass('sideCatalog-down-enable');
$('#sideCatalog-up').removeClass('sideCatalog-up-enable').addClass('sideCatalog-up-disable');
} else if (index > 11) {
$('#sideCatalog-catalog dl').stop().animate({'top': -enableTop}, 'fast');
$('#sideCatalog-down').removeClass('sideCatalog-down-enable').addClass('sideCatalog-down-disable');
$('#sideCatalog-up').removeClass('sideCatalog-up-disable').addClass('sideCatalog-up-enable');
} else {
var dlTop = parseInt($('#sideCatalog-catalog dl').css('top')) slideOutHeight / 2 - (that.offset().top - $(document)。
$('#sideCatalog-catalog dl').stop().animate({'top': dlTop}, 'fast');
$('#sideCatalog-down').removeClass('sideCatalog-down-disable').addClass('sideCatalog-down-enable');
$('#sideCatalog-up').removeClass('sideCatalog-up-disable').addClass('sideCatalog-up-enable');
}
}