FloatLabel.js
A jQuery plugin for floating form labels
Install / Use
/learn @m10l/FloatLabel.jsREADME
FloatLabel.js
A jQuery plugin for floating form labels.
Based on a UI concept by Matt D. Smith.
Usage
Add jquery.FloatLabel.css to your websites stylesheets and jquery.FloatLabel.js to your scripts.
- Add jquery.FloatLabel.js to your scripts. Example -
<script src="scripts/jquery.js"></script>
<script src="scripts/jquery.FloatLabel.js"></script>
<script src="scripts/main.js"></script>
- Add jquery.FloatLabel.css to your stylesheets. Example -
<link rel="stylesheet" href="styles/normalize.css">
<link rel="stylesheet" href="styles/jquery.FloatLabel.css">
<link rel="stylesheet" href="styles/main.css">
- Wrap the fields you wish to effect with your chosen class. Example -
<div class="js-float-label-wrapper">
<label for="name">Name</label>
<input id="name" type="text">
</div>
- Initialise FloatLabel.js, passing the plugin your input/label wrapper class. Example -
$( '.js-float-label-wrapper' ).FloatLabel();
Customisation
As FloatLabel.js works by using CSS classes, the animations can be tweeked within jquery.FloatLabel.css.
If the default classes conflict with the rest of your CSS for whatever reason, you can change them by passing in paramaters when you initialise the plugin. Don't forget to update jquery.FloatLabel.css with your new class names if you need to make a change.
$( '.js-float-label-wrapper' ).FloatLabel({
populatedClass : 'custom-populated-class',
focusedClass : 'custom-focused-class'
});
Related Skills
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
