
內容簡介
```html
<!DOCTYPE html>
<html>
<body>
<h3>WordPress 外掛總結:</h3>
<p>「Contact Form Lazyload」是一個輕量級的 WordPress 外掛,旨在通過惰性加載 Contact Form 7 來提高網站性能。這個外掛會延遲加載聯絡表單,直到它們出現在視口內,從而減少初始加載時間並增強用戶體驗。</p>
<h3>問題與答案:</h3>
<ul>
<li>
<strong>root-margin 參數如何設置?</strong>
<p>「root-margin」支持像 px 和 % 這樣的單位。可以通過以下幾種方式來設置 root-margin:</p>
<ul>
<li>root-margin: 100px - 表單將在指定元素前 100 像素處加載。</li>
<li>root-margin: -100px - 表單將在指定元素後 100 像素處加載。</li>
<li>root-margin: 20px 50px 20px - 表單將使用 20px 的上邊距、50px 的側邊距和 20px 的底邊距加載。</li>
</ul>
</li>
<li>
<strong>什麼是 no-observer 參數?</strong>
<p>「no-observer」是針對希望完全控制表單何時加載的開發人員而設計的解決方案。將此選項設置為 true 將阻止表單自動在頁面上加載,您需要通過 JavaScript 手動將「data-fsdpcfl-src」屬性更改為「src」。</p>
</li>
</ul>
<p>如有任何問題,請通過電子郵件聯繫我們:[email protected]</p>
</body>
</html>
```
外掛標籤
開發者團隊
原文外掛簡介
Lazyload for Contact Form 7 is a lightweight WordPress plugin designed to improve your website’s performance by lazyloading Contact Form 7. This plugin delays the loading of contact forms until they are in the viewport, reducing initial load times and enhancing user experience.
Example code:
[lazy-contact-form-7 id="ID form" title="Title form" root-margin="0px" no-observer="false"]
root-margin=”0px”
root-margin=”0px” sets the size of the base margin, allowing the form to load sooner or later. Root-margin can be set in several ways:
– root-margin supports units such as px and %.
– root-margin: 100px – the form will load 100 px before the specified element.
– root-margin: -100px – the form will load 100 px after the specified element.
– root-margin: 20px 50px 20px – the form will load with margins of 20px on top, 50px on the sides, and 20px on the bottom.
no-observer=”true”
no-observer=”true” Is a solution aimed at developers who want to have control over exactly when the form is loaded. Setting this option to true will prevent the form from loading automatically on the page, and you will need to manually change the data-fsdpcfl-src attribute to src using JavaScript.
To enable the loading animation, add the active class to the fsdpcfl-loader class.
If you have any questions, you can contact us via email. [email protected]
