التعليق: يقدم هذا المقال بشكل أساسي سمة HTML 5 للمؤتمرات النائبة لتخدم مثالي كـ IE. يمكن للأصدقاء الذين يحتاجون إليها الرجوع إليها
تذكر أن تشير إلى مكتبة فئة jQuery$ (وثيقة). ready (function () {
إذا ($ .browser.msie)
$ ("الإدخال: النص ، الإدخال: كلمة المرور"). كل (دالة () {
var $ leacholder = $ (this) .ATTR ("leactolder") ؛
var $ width = $ (this) .css ("width") ؛
var $ id = $ (this) .attr ("id") ؛
var $ height = parseint ($ (this) .css ("height")) + 6 + "px" ؛
var $ fontsize = $ (this) .css ("font-size") ؛
var $ fontweight = $ (this) .css ("font-weight") ؛
var $ lineheight = $ height ؛
if ($ (this) .css ("line-height")! = "Normal") {
$ lineHeight = parseint ($ (this) .css ("line-height")) + 6 + "px" ؛
}
if ($ $ legholder! = undefined) {
$ (هذا). بعد ("<span class =/" placeholder ph_ " + $ id +"/"style =/" width: " + $ width +" ؛ line-height: $ النائب + "</span>") ؛
}
$ (this) .bind ("keyup" ، function () {
if ($ (this) .val () == "") {
$ (هذا) .parent ().
}
آخر {
$ (هذا) .parent ().
}
}) ؛
}) ؛
$ (".
$ (هذا) .prev (). Focus () ؛
}) ؛
}) ؛
استدعاء الصفحة
<type type = "text" placeholder = "أنا أطلب من المحتوى طبيعيًا" />
<type type = "text" placeholder = "أنا أؤيد عرض وارتفاع المحتوى" />
<type type = "text" placeholder = "أنا أؤيد المحتوى لدي أنماط أخرى" />
<type type = "text" placeholder = "يمكنك تجربة الآخرين" />
أسلوب
<type type = "text/css">
.placeholder {display: inline block ؛ color: Gray ؛ align-align: top ؛ overflow: hidden ؛}
</style>