我知道有很多伟大的插件用于此目的,但我觉得这是我想用很多东西,所以我想看看它是如何完成的!我知道你能做到这样:jQuery 100%垂直滚动(幻灯片滚动)
HTML:
<div id="section1">
<div id="section2">
CSS:
#section1{
height: 100%;
width: 100%;
position: absolute;
top: 0;
left: 0;
}
#section2{
height: 100%;
width: 100%;
position: absolute;
top: 100%;
left: 0;
}
#section1:active{
position: fixed;
}
#section2:active{
position: fixed;
}
的jQuery:
$(".wrapper").on('mousewheel DOMMouseScroll', function (event) {
if (event.originalEvent.wheelDelta > 0 || event.originalEvent.detail < 0) {
$('.slide-1').addClass('active');
} else {
$('.slide-2').addClass('active');
}
});
我想学习如何做到这一点的最好办法。我很抱歉,代码只是我写的很快。
[fullPage js](http://www.alvarotrigo.com/fullPage/)值得一看 –
我不想使用库 –