Input placeholder attribute IE, 360 browser compatibility, placeholder360

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.