Comments (1)
I wrote one of these when we were first working on base. Not sure if its still useful, but here it is:
(function($){
$.fn.placeholder = function() {
return this.each(function() {
//variables
var element = $(this);
var placeholder = element.attr("placeholder");
//set default placeholder
element.val(placeholder).addClass("placeholder");
//remove any labels provided for non-js users
if(element.attr("id").length > 0){
$("label[for="+element.attr("id")+"]").remove();
}
//show/hide placeholder on blur/focus
element.focus(function(){
if(element.val()==placeholder)
element.val("").removeClass("placeholder");
}).blur(function(){
if(element.val()=="")
element.val(placeholder).addClass("placeholder");
});
});
};
})(jQuery);
from base.
Related Issues (20)
- Change font sizing from ems to rems HOT 1
- No Version info in README
- Make the Gruntfile better HOT 3
- Update Base to latest version HOT 1
- Responsive Menus HOT 3
- Filter not reset on disabled buttons HOT 1
- Remove padding variable HOT 1
- Menus: primary sub menu off-screen in mobile; secondary submenu not hidden; submenus background color
- Mixin for columns with no margin
- Add tooltips HOT 1
- Add float: left / right as an argument for column mixin HOT 1
- Upgrade style injector in Gruntfile
- Updated grunt config (since minification) error
- Add universal box sizing
- Offset mixin bug HOT 1
- Set font-size on html, not body, when using REMs
- Include a clearfix / add clearfix docs HOT 1
- Select boxes lose drop-down styles in FF, Chrome, Safari HOT 1
- Automatically apply base button styles to links with the .button-primary (etc) class HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from base.