Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 64 lines (44 sloc) 2.764 kB
0e03052 1.6 optional reformat when a textarea is being resized
Dirk Ginader authored
1 HTML5 placeholder Polyfill
2 ==========================
756fb58 added readme
Dirk Ginader authored
3
2221a14 update readme Version 1.3
Dirk Ginader authored
4 Lightweight and very robust little jQuery Plugin that generates the look and feel of the HTML5 placeholder attribut for Browsers without native support. It also adds an extra title in case the placeholder text is too long to be displayed.
bc0650a updated readme with usage information
Dirk Ginader authored
5 The polyfill comes with an option to define if the placeholder text should be read to screenreaders or not (on by default).
2221a14 update readme Version 1.3
Dirk Ginader authored
6
06339f9 feature both examples in the readme
Dirk Ginader authored
7 * __[check out the DEMO](http://blog.ginader.de/dev/jquery/HTML5-placeholder-polyfill/)__
8 * __[check out the DEMO using Modernizr to load the Polyfill](http://blog.ginader.de/dev/jquery/HTML5-placeholder-polyfill/index-modernizr.html)__ (Thanks to Modernizr/yepnope nothing needs to get loaded when the Browser natively supports the placeholder)
1b09801 moved demo link up
Dirk Ginader authored
9
756fb58 added readme
Dirk Ginader authored
10
bc0650a updated readme with usage information
Dirk Ginader authored
11 Requires:
12 ---------
756fb58 added readme
Dirk Ginader authored
13
bc0650a updated readme with usage information
Dirk Ginader authored
14 * [jQuery](http://jquery.com/) (tested with 1.6.2 but might as well work with older versions)
15 * [Modernizr](http://www.modernizr.com/) (tested with 2.0.6) OR [yepnope.js](http://yepnopejs.com/)
756fb58 added readme
Dirk Ginader authored
16
17 optional but recommended:
18
0e03052 1.6 optional reformat when a textarea is being resized
Dirk Ginader authored
19 * [fontresize](https://github.com/johnantoni/jquery.onfontresize) (excellent even though terribly unmaintained event plugin that fires when a user changes the fontsize of their Browser (that usually breaks the other placeholder polyfills))
20
21 highly optional (only needed if you want users to be able to resize textareas):
22
23 * [jquery-resize](https://github.com/cowboy/jquery-resize) if included a repositioning is triggered when a user resizes a textarea. If not I disable the resizing of textareas to avoid rendering problems
bde60e3 added link to demo
Dirk Ginader authored
24
1cef277 Version 1.3 new features
Dirk Ginader authored
25 The Placeholder Attribute has decent support across current Browsers. This Script adds support for the older generations including:
26
27 * Internet Explorer < 10
28 * Firefox < 4.0
29 * Safari < 4.0
30 * iOS Safari < 4.0
31 * Android Safari
32
bc0650a updated readme with usage information
Dirk Ginader authored
33 for more details on native support see the Browser suppport table at [caniuse.com](http://caniuse.com/#search=placeholder)
34
35 USAGE:
36 ------
37
b5e3f3c 1.7 feature detection is now included in the polyfill so you can simp…
Dirk Ginader authored
38 ### Simply include the Javascript and CSS. The Polyfill will only run when needed
39
40 <head>
e2c3cee better explanation of the optional includes in the new example
Dirk Ginader authored
41 <link rel="stylesheet" href="placeholder_polyfill.min.css">
42 <script src="placeholder_polyfill.jquery.min.combo.js" charset="utf-8"></script>
b5e3f3c 1.7 feature detection is now included in the polyfill so you can simp…
Dirk Ginader authored
43 </head>
44
45 ### using [Modernizr](http://www.modernizr.com/) modern Browser don't even have to load the Polyfill at all
bc0650a updated readme with usage information
Dirk Ginader authored
46
47 Modernizr.load({
48 test: Modernizr.input.placeholder,
49 nope: [
eff3c97 updated readme to show the minified and combined version for easy cop…
Dirk Ginader authored
50 'placeholder_polyfill.min.css',
51 'placeholder_polyfill.jquery.min.combo.js'
bc0650a updated readme with usage information
Dirk Ginader authored
52 ]
53 });
54
b5e3f3c 1.7 feature detection is now included in the polyfill so you can simp…
Dirk Ginader authored
55 ### using [yepnope.js](http://yepnopejs.com/) (used as load() in Modernizr) the same as with Modernizr but with manual feature detection
bc0650a updated readme with usage information
Dirk Ginader authored
56
57 yepnope({
58 test: ('placeholder' in $('<input>')[0]),
59 nope: [
eff3c97 updated readme to show the minified and combined version for easy cop…
Dirk Ginader authored
60 'placeholder_polyfill.min.css',
61 'placeholder_polyfill.jquery.min.combo.js'
bc0650a updated readme with usage information
Dirk Ginader authored
62 ]
b5e3f3c 1.7 feature detection is now included in the polyfill so you can simp…
Dirk Ginader authored
63 });
Something went wrong with that request. Please try again.