manhcodedao / jquery-watermark

Automatically exported from code.google.com/p/jquery-watermark
0 stars 0 forks source link

add some feature #84

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
1. add $.watermark.options.defaultWaterMark, when call 
$(<selector>).watermark(text, options) time, the text is nullorempty, use 
defaultWaterMark.

2. support the watermark-text on element attribute. example : 
<input type="text" watermark="cccc" />
<script>
    $(function(){
        // all has watermark attribute element, show watermark.
        $('[watermark]').watermark();
    });
</script>

3. 1 && 2 feature, call the watermark can to short, example
<style>
.redfont{
    font: red;
}
</style>
<input id="one" type="text" watermark="cccc" />
<input id="two" type="text" watermark />
<script>
    $(function(){
        // all has watermark attribute element, show watermark.
        $('[watermark]').watermark({className: 'redfont'});
    });
</script>

result:
1. all the watermark className is change to redfont. 
2. $('#two') element, watermark-text is $.watermark.options.defaultWaterMark 
value.

that's all...

i come from china, english no good, Please forgive me。

If do not understand, please call me mail. ygaSonic@gmail.com

attach my change jquery.watermark from 3.1.3, Increase of the above three 
functions.

Original issue reported on code.google.com by ygaSo...@gmail.com on 9 Jun 2012 at 4:11

Attachments:

GoogleCodeExporter commented 8 years ago
This issue is fixed in the latest release (3.2.0) with the addition of the 
textAttr option.

Original comment by t...@speednet.biz on 16 Aug 2014 at 4:54