我已經搜索了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