[WordPress] 外掛分享: Floating Labels for CF7

首頁 › 外掛目錄 › Floating Labels for CF7
WordPress 外掛 Floating Labels for CF7 的封面圖片
全新外掛
安裝啟用
—
尚無評分
剛更新
最後更新
—
問題解決
WordPress 6.5+ PHP 8.1+ v1.1.0 上架:2026-11-28

外掛標籤

開發者團隊

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

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

原文外掛簡介

A floating label sits inside the empty field like a placeholder and moves to the top edge, smaller, as soon as the field is focused or filled. The label stays visible the whole time and is a real

Works with existing forms: labels of the form template and placeholder options become floating labels automatically. Older templates with loose text in front of the fields (

Your Name
[text* your-name]

) are covered by the option “Text before the field”.
Three variants: Outlined (label floats onto the border), Filled (tinted box) and Minimal (your theme styles the field, the label floats above it).
Focus effects: a glow, a pulsing glow or a light running around the border of the focused field, in a colour of your choice. Pure CSS; visitors who prefer reduced motion see them without movement.
Pure CSS on the front end: focus, filled, autofill and error states come from CSS pseudo-classes. No JavaScript on your pages; the only inline styles are the design values you change (one short rule after the stylesheet, and a style attribute on forms with their own design values).
Accessible: every rebuilt field gets a real

錯誤: 找不到符合條件的聯絡表單。

shortcode, get “Floating labels” panels in the sidebar: the placement settings, and colours, sizes, animation and focus effect for that placement only; no classes to type, and a reset button in every panel.
Design settings: colours with the WordPress colour picker, font size, padding, border, corner radius, the animation and the focus effect on the settings screen, or per placement in the block editor; every value is also a CSS custom property, so themes can set them too.
Sample page on request: a private page with forms that show every option, created and removed with one click on the settings screen.
Lightweight: one option, one stylesheet (on every page like the Contact Form 7 stylesheet, or only on pages with a form), no database tables, no cron, no external requests, no tracking.

Field types
Text, email, URL, telephone, number, date, textarea and select fields get floating labels. The label of a date field stays floated, because browsers show a format mask in the empty field. So does the label of a select, except while its blank option (include_blank or first_as_label) is selected: then the label rests in the field and the text of that option is hidden, so the label is the only hint. Checkboxes, radio buttons, selects with multiple choice, file uploads, quizzes and CAPTCHAs never get floating labels; they keep their original markup.
Per form
Open the tab “Floating labels” in the editor of a form and pick the values: on or off, the label source, the variant, the focus effect, the required marker and, optionally, a limit on the field types. They are saved as these lines in the form’s “Additional Settings” tab, which you can also write by hand:
jgor_floating_labels: off
jgor_floating_labels: placeholder
jgor_floating_labels: label
jgor_floating_labels: text
jgor_floating_labels_style: filled
jgor_floating_labels_effect: glow
jgor_floating_labels_marker: on
jgor_floating_labels_types: text email textarea

Per placement
The same form can look different on different pages. Select the Contact Form 7 block, or a Shortcode block with the

錯誤: 找不到符合條件的聯絡表單。

shortcode, and open the panel “Floating labels” in the block sidebar: it offers on/off, the label source, the variant, the focus effect and the required marker for this placement. The choice is stored as classes in the block’s “Class” field (panel “Form attributes”) or in the html_class attribute of the shortcode, which you can also write by hand:
jgor-flcf7-off jgor-flcf7-on
jgor-flcf7-mode-placeholder jgor-flcf7-mode-label jgor-flcf7-mode-text
jgor-flcf7-style-outlined jgor-flcf7-style-filled jgor-flcf7-style-minimal
jgor-flcf7-effect-none jgor-flcf7-effect-glow jgor-flcf7-effect-pulse jgor-flcf7-effect-sweep
jgor-flcf7-marker-on jgor-flcf7-marker-off

Example:

錯誤: 找不到符合條件的聯絡表單。


The panels “Floating labels: colours”, “Floating labels: sizes”, “Floating labels: animation” and “Floating labels: focus effect” below it set colours, sizes, the animation and the look of the focus effect for this placement only. Leave a control empty to keep the value of the settings screen; the reset button at the end of each panel clears its values, and “Reset this placement” in the panel “Floating labels” clears the choices and all design values of this placement. The values are stored with the block, or in the jgor_flcf7_design attribute of the shortcode, which you can also write by hand (property names as on the settings screen, without the prefix):

錯誤: 找不到符合條件的聯絡表單。

Per field
Add the option jgor_nofloat to a form-tag, before any quoted value:
[text* your-name jgor_nofloat placeholder "Your name"]

Colours and sizes
Open Contact > Floating Labels, section Design: colours for the label, the border, the field background and the submit button on errors (WordPress colour picker), the font size of the field and of the label, padding, border width, corner radius, the scale of the floated label, the duration of the animation, and the colour, size, width and duration of the focus effect. Leave a field empty to keep the default. Only the values you change are printed, as CSS custom properties on the .wpcf7 wrapper, right after the stylesheet. For one placement only, use the panels in the block editor (see “Per placement”); those values are printed as a style attribute on the wrapper of that form.
Themes can set the same properties in CSS, for example in Appearance > Customize > Additional CSS or a child theme:
.wpcf7 {
--jgor-flcf7-label-size: 0.9em;
--jgor-flcf7-border-color-active: #0a7d3e;
}

To style one form only, replace .wpcf7 with the id of its wrapper, for example [id^="wpcf7-f123-"]. The settings screen shows the full list of properties with the values in effect.
For developers

jgor_flcf7_settings: fix settings in code; the settings screen shows them disabled.
jgor_flcf7_form_settings: change the effective settings per rendering (mode, types, variant, focus effect, required marker).
jgor_flcf7_enabled: switch floating labels on or off per form.
jgor_flcf7_label_text: change the label text per field.
jgor_flcf7_field_types: extend the list of selectable field types.

Requirements and privacy
The plugin needs Contact Form 7 (5.0 or newer) and the PHP extension DOM, which is part of every standard PHP build. It stores one option in the WordPress database (a second one while the sample page exists), sends no data anywhere and loads nothing from third-party servers.
Contact Form 7 is a trademark of Rock Lobster, Inc. This plugin is an independent add-on and is not affiliated with or endorsed by Rock Lobster, Inc.

延伸相關外掛

文章
Filter
Mastodon