[WordPress] 外掛分享: Fast Smooth Scroll

首頁外掛目錄 › Fast Smooth Scroll
800+
安裝啟用
★★★★★
5/5 分(3 則評價)
114 天前
最後更新
問題解決
WordPress 5.0+ PHP 5.2+ v1.0.0 上架:2023-12-30

內容簡介

外掛總結:
- 這個外掛簡單直接,提供快速且高效的使用者體驗。
- 啟用外掛後,所有的錨點連結(指向同一頁面上其他內容的連結)將提供平滑捲動的體驗,而非突然跳轉到目標內容。
- 這個外掛使用最新的 CSS 平滑捲動技術,同時包含一個非常快速輕量的 JavaScript polyfill(小於1KB),可以兼容舊版瀏覽器,包括Internet Explorer。使用者可以放心使用,這個外掛可以滿足您的使用者群體需求。

問題與答案:
- 這個外掛為什麼存在?
- 平滑捲動是增加使用者體驗的基本功能,所以它不應該以牺牲其他使用者體驗為代價而降低效能。
- 很多其他平滑捲動解決方案遺憾地依賴於過時的技術,例如jQuery,這可能會影響網站的效能,而且並不是提供此功能所必需的。即使是10年前的瀏覽器也不需要jQuery來實現平滑捲動。事實上,截至今天,您只需要使用CSS就可以實現該行為,甚至不需要使用JavaScript。
- 使用這個外掛相較於其他平滑捲動解決方案的另一個潛在原因是可訪問性:這個外掛尊重使用者關於減少動作的偏好,這可以避免臨床前運動障礙患者產生不適感。
- 您可能已經使用了平滑捲動的外掛,但是值得再次檢查一下,確保它不使用那些過時、效能低下和無法訪問的方法,以免拖慢網站速度或對使用者的互動產生負面影響。

- 更多技術細節:
- 這個外掛通過 scroll-behavior CSS 屬性實現平滑捲動。這個屬性在所有現代瀏覽器中已經得到支持數年。
- 為了支援舊版瀏覽器,它包含一個輕量級的JavaScript polyfill,只會在不支援 CSS 屬性的瀏覽器中載入,並且不需要任何依賴。這個polyfill使用最新的JavaScript使用者體驗最佳實踐,如requestAnimationFrame,提供平滑捲動體驗,而不會阻塞其他使用者互動。
- 有關相關瀏覽器支援,請參閱:
- CSS Scroll-behavior
- CSS 屬性:scroll-padding-top
- prefers-reduced-motion 媒體查詢
- requestAnimationFrame
- 高解析度時間API
- NodeList API
- Window API:scrollTo

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Fast Smooth Scroll」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

This plugin takes a no-frills approach to smooth scrolling, providing a fast, performant, and accessible user experience.
Simply enable the plugin, and any anchor links (i.e. links that point to other content on the same page) will provide a smooth scrolling experience rather than abruptly jumping to the destination content.
The plugin relies on the latest smooth scrolling techniques using CSS. A very fast and lightweight JavaScript polyfill (<1KB) is included to equally support older browsers, including Internet Explorer. So you can rest assured this plugin covers your userbase. Why does this plugin exist? Smooth scrolling is a basic feature to enhance user experience, so it shouldn’t come at a performance cost that at the same time harms user experience elsewhere. Several other smooth scrolling solutions unfortunately rely on outdated techniques such as jQuery, which can hurt your site’s performance, and is really not necessary to provide the feature. Even browsers as old as 10 years don’t need jQuery to achieve smooth scrolling. In fact, as of today you can achieve the behavior with only CSS, not even requiring any JavaScript. Another potential reason to use this plugin over other smooth scrolling solutions is accessibility: This plugin respects the user preferences around reduced motion, which can avoid discomfort for those with vestibular motion disorders. You may already use a smooth scrolling plugin, but it is worth double checking that it doesn’t use one of those outdated, inefficient, and inaccessible approaches that may slow down your site or affect user interactions negatively. More technical details This plugin simply enables smooth scrolling with the scroll-behavior CSS property. This property has been supported by all modern browsers for a few years now. To support older browsers as well, a lightweight JavaScript polyfill is included, which is only loaded for browsers that lack support for the CSS property and doesn’t require any dependencies. The polyfill uses latest JavaScript user experience best practices such as requestAnimationFrame to provide a smooth scrolling experience without potentially blocking other user interactions. For relevant browser support, see: * CSS Scroll-behavior * CSS property: scroll-padding-top * prefers-reduced-motion media query * requestAnimationFrame * High Resolution Time API * NodeList API * Window API: scrollTo

延伸相關外掛

文章
Filter
Mastodon