Input placeholder attribute IE, 360 browser compatibility, placeholder360
Effect: http://hovertree.com/texiao/jquery/43/
Effect 2: http://hovertree.com/texiao/jquery/43/1/
Try it in IE.
1. Create a JS file: jquery. JPlaceholder. js
The js Code is as follows:
/** JQuery placeholder, fix for IE6, 7,8, 9 * hovertree.com */var JPlaceHolder = {// check _ function () {return 'placeholder 'in document. createElement ('input');}, // initialize init: function () {if (! This. _ check () {this. fix () ;}}, // fix the question: fix: function () {jQuery (': input [placeholder]'). each (function (index, element) {var self = $ (this), txt = self. attr ('holder'); self. wrap ($ ('<div> </div> 'salary .css ({position: 'relative', zoom: '1', border: 'none', background: 'none ', padding: 'none', margin: 'none'}); var pos = self. position (), h = self. outerHeight (true), paddingleft = self.css ('padding-left'); v Ar holder = $ ('<span> </span> 'salary .text(txt0000.css ({position: 'absolute', left: pos. left, top: pos. top, height: h, lienHeight: h, paddingLeft: paddingleft, color: '# aaa '}). appendTo (self. parent (); self. focusin (function (e) {holder. hide ();}). focusout (function (e) {if (! Self. val () {holder. show () ;}}); holder. click (function (e) {holder. hide (); self. focus () ;}) ;}}; // run jQuery (function () {JPlaceHolder. init ();});
2. Use the following methods on the page:
<! Doctype html>
Practice is the only criterion for testing truth, hoping to help everyone.
Reference: http://hovertree.com/h/bjaf/ww7ek8wn.htm
Http://www.cnblogs.com/roucheng/p/csslogin.html
More effect: http://www.cnblogs.com/roucheng/p/texiao.html