有人可以幫助我使用jquery或javascript幫助我的搜索按鈕。每當用戶懸停我的搜索按鈕時,我希望搜索框出現(並保持可見狀態,同時用戶stil在那裏搜索某物),但是當鼠標遠離搜索按鈕或搜索框時,這個小盒子應該消失。使用jquery動畫按鈕
<div class = "searchBox">
<p id = "paragraph"><input type = "text" name = "serachBar"/>
<input type = "button" value = "szukaj" name = "search"/>
</p>
<div id = "searchButton"><a href = "#">Search</a></div>
</div>
CSS
body{
background-color:rgb(138,187,129);
#searchButton{
position:fixed;
border:1px solid rgb(255,255,255);
border-top:none;
width:80px;
height:30px;
top:0px;
right:60px;
border-radius:0px 0px 3px 3px;
background:rgb(30,114,41);
}
#searchButton :hover{
background:rgba(0,0,0,0.3);
}
#searchButton a{
text-decoration:none;
font-size:20px;
font-family:"Palatino Linotype", "Book Antiqua", Palatino, serif;
text-align:center;
color:white;
padding:0;
margin:0;
display:block;
height:100%;
width:100%;
}
.searchBox p{
position:fixed;
border-bottom:1px solid rgba(255,255,255,0.3);
border-radius:2px;
box-shadow:0 1px 2px 2px #1F0000;
-moz-box-shadow:0 1px 2px 2px #1F0000;
-webkit-box-shadow:0 1px 2px 2px #1F0000;
border-top:none;
background:rgba(0,0,0,0.2);
width:200px;
height:50px;
top:0;
right:0;
margin:0;
visibility:hidden;
font-size:15px;
font-family:"Palatino Linotype", "Book Antiqua", Palatino, serif;
color:white;
}
你應該張貼,是有關您的問題的代碼 - 我們大多數人都不愛讀無關的代碼。 – 2013-04-26 19:05:43