placeholder怎么用,html指定ie文档模式
记得引用jquery类库
$(document ).ready (function ) )。
if($.browser.msie ) )。
$(input:text,input:password ' ).each(function () ) ) ) )。
var $placeholder=$(this ).attr(placeholder );
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($placeholder!=未定义) {
$(this ).after('$placeholder ' );
}
$(this ).bind )、keyup )和function ) )。
if($ ) this ).val )==' ' ) {
$(this ).parent ) ).find ).ph_'$id ).CSS )、' inline-block ' );
}
else {
$(this ).parent ) ).find ).ph_'$id ).CSS ) ' display ',' none ' );
}
);
);
$('.placeholder ' ).live('click ',function ) )。
$(this ).prev ).focus );
);
);
页面调用
. placeholder { display :在线块; color:gray; 垂直对齐3360 top; Overflow :隐藏; }