我已经搜索了3个小时,找不到解决方案。所有即时消息都是当你点击一个表单中的输入字段时,一侧的信息框会显示出来。我试图搞乱jQuery,只是无法让它工作,即使我确定代码是正确的(我们不是总是哈哈)。点击信息框显示
无论如何,ID欣赏任何解决方案。
我在的jQuery/CSS/HTML的尝试看起来像这样
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<style>
.infoBubble {
visibility:hidden;
color:#000;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script>
$('.box').click(function() {
$('.infoBubble').css({'visibility':'visible'});
});
</script>
</head>
<body>
<form action="process.php" method="get">
<div class="row">
<span class="label">Description: </span>
<input type="text" name="description" id="description" class="box" /><span class="infoBubble">Specific information related to this input</span>
</div>
</form>
</body>
</html>
知名度是有效的。 'visibility:hidden'隐藏一个元素,但不会将其从文档流中移除。 'display:none'隐藏一个元素并将其从页面流中移除。 http://stackoverflow.com/questions/133051/what-is-the-difference-between-visibilityhidden-and-displaynone –
当属性仍然在页面占用相同的间距和位置,但不可见时使用visibilty。显示完全删除它。 – user29660