Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

44 lines (25 sloc) 0.996 kb

jQuery-Watermark

An extra-small ( <1k ) and easy watermark creator for inputs.

A working demo is under sample folder.

Installation

Go to the fridge and drink some beer.

Include jQuery script:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>

Download jquery-watermark.min.js script and include it in your page:

<script src="jquery-watermark.min.js" type="text/javascript"></script>

Define your params (if you want):

var params = { activeCss: { 'color': 'Black', 'background-color': 'Blue', 'font-size': '20px' }, waterCss: {color: 'Gray'}};

The defaults are:

'waterCss': { color: 'Gray' },
'activeCss':  { color: 'Black' }

From within your code call to the watermark() function on your selector (in this case i used input fields).

$("input").watermark(params);

Go and have another beer.

Contribution

  • Sagiv Ofek

License

free for all! :)

Jump to Line
Something went wrong with that request. Please try again.