Форма с class="checkMax3"
ниже отображает текст на несколько пикселей ниже, чем следует.В Chrome буквы, такие как строчные буквы "p" и "q", простираются ниже нижней части поля.В IE 8 нижняя часть этих же букв не отображается.
Если я правильно помню, эта проблема началась после того, как я применил приведенный ниже Javascript к полю.
Есть идеи, как мне сделать так, чтобы буквы типа "q" и "p" целиком помещались в поле?Поле кажется достаточно высоким, чтобы содержать буквы, но текст кажется на 5 пикселей слишком низким в поле.
Заранее спасибо,
Джон
JavaScript:
<script language="javascript" type="text/javascript" src="jquery-1.2.6.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready( function () {
setMaxLength();
$("input.checkMax3").bind("click mouseover keyup change", function(){checkMaxLength(this.id); } )
});
function setMaxLength() {
$("input.checkMax3").each(function(i){
intMax = $(this).attr("maxlength");
$(this).after("<div class='commchar2'><span id='"+this.id+"Counter'>"+intMax+"</span> characters remaining</div>");
});
}
function checkMaxLength(strID){
intCount = $("#"+strID).val().length;
intMax = $("#"+strID).attr("maxlength");
strID = "#"+strID+"Counter";
$(strID).text(parseInt(intMax) - parseInt(intCount));
if (intCount < (intMax * .8)) {$(strID).css("color", "#006600"); } //good
if (intCount > (intMax * .8)) { $(strID).css("color", "#FF9933"); } //warning at 80%
if (intCount > (intMax)) { $(strID).text(0).css("color", "#990000"); } //over
}
</script>
PHP / HTML:
echo '<form action="http://www...com/.../submit2a.php" method="post">
<input type="hidden" value="'.$_SESSION['loginid'].'" name="uid">
<div class="submissiontitle"><label for="title">Story Title:</label></div>
<div class="submissionfield"><input class="checkMax3" name="title" type="title" id="title" maxlength="80"></div>
<div class="urltitle"><label for="url">Link:</label></div>
<div class="urlfield"><input name="url" type="text" id="url" maxlength="500"></div>
<div class="submissionbutton"><input name="submit" type="submit" value="Submit"></div>
</form>
';
CSS:
.submissionfield
{
position:absolute;
width:550px;
left:30px;
top:230px;
text-align: left;
vertical-align:text-top;
margin-bottom:10px;
padding:2px;
font-family: "Times New Roman", Times, serif;
font-size: 22px;
line-height: 30px;
color:#000000;
}