我正在編寫一個網站,我想構建一些窗口大小的div /節。當用戶停止在這兩個div之間滾動時,需要更多空間的div應在滾動,因此它將是全窗口大小。滾動後滾動到下一個錨點
5
A
回答
-2
我沒有這種第三方插件的經驗,所以我不能推薦「最好」的。
但這裏有一些例子:
http://guidobouman.github.io/jquery-panelsnap/
http://wtm.github.io/jquery.snapscroll/
我相信這是你在找什麼。
編輯:這一個看起來不錯,也https://projects.lukehaas.me/scrollify/#options
1
有jQuery插件做到這一點,但這裏有一個很好的模板,以瞭解如何實現自己:
https://startbootstrap.com/template-overviews/scrolling-nav/
這裏的相關滾動JavaScript的easing功能,使其很好,可滾動:
//jQuery to collapse the navbar on scroll
$(window).scroll(function() {
if ($(".navbar").offset().top > 50) {
$(".navbar-fixed-top").addClass("top-nav-collapse");
} else {
$(".navbar-fixed-top").removeClass("top-nav-collapse");
}
});
//jQuery for page scrolling feature - requires jQuery Easing plugin
$(function() {
$('a.page-scroll').bind('click', function(event) {
var $anchor = $(this);
$('html, body').stop().animate({
scrollTop: $($anchor.attr('href')).offset().top
}, 1500, 'easeInOutExpo');
event.preventDefault();
});
});
0
FullPage.js完全符合你的需求。
如果整個庫是你需要的東西太重了,你可以嘗試這樣的事情https://github.com/alvarotrigo/fullPage.js/blob/master/pure%20javascript%20(Alpha)/javascript.fullPage.js#L897-L913
相關問題
- 1. 滾動到多個錨點
- 2. 提交後自動滾動到錨點
- 3. 滾動到jquery.load後的錨點
- 4. 打開fancybox後滾動到錨點
- 5. 間隔後滾動到錨點
- 6. 簡單滾動到錨點
- 7. jquery滾動到錨點-60px
- 8. 水平滾動到錨點
- 9. 鼠標滾動到錨點
- 10. 多次滾動到錨點
- 11. 滾動到錨
- 12. 平滑滾動 - 無法一直滾動到錨點標記
- 13. 平滑滾動到多個錨點
- 14. jQuery動畫滾動到錨點
- 15. 使用jQuery鍵盤從錨點動態滾動到錨點
- 16. 滾動到具有uRL中多個錨點的錨點,
- 17. 滾動錨點未激活
- 18. 使用jQuery滾動錨點
- 19. 停止錨滾動點擊
- 20. jQuery:錨點滾動跳躍
- 21. 滾動到下一個類
- 22. AngularJS:狀態變化後自動滾動到錨點
- 23. 頁面跳轉到錨點後移動屏幕滾動位置?
- 24. 在CSS動畫之後滾動到錨點?
- 25. 在JS動畫/序列後滾動到一個特定的錨點
- 26. jQuery平滑滾動到錨點
- 27. JQuery滾動到點擊錨定?
- 28. 我如何滾動到錨點?
- 29. Jquery scrollTo Plugin:滾動到錨點
- 30. 滾動到錨點不工作
似乎你loooking爲[fullPage.js(http://alvarotrigo.com重新實現邏輯/ fullPage /)但保持滾動條?看看[這個演示](http://alvarotrigo.com/fullPage/examples/normalScroll.html)或[this other one](http://alvarotrigo.com/fullPage/examples/scrollBar.html)。 – Alvaro