我試圖讓一個搜索欄擴展到某些鏈接。一旦您點擊我已有的放大鏡圖像並在「登錄」鏈接上展開,它就會展開。 它不必工作!這只是爲了演出。通過特定鏈接擴展搜索欄
爲了獲得更多的視覺您可以訪問我的網頁here,看看我的意思是對放大鏡圖示和登錄。
要獲得更多關於我想要的設想,請訪問here。這正是我想以各種方式想要的......更適合我的網站。當我下載這些文件時,我感到困惑,因爲它有太多的元素以至於我不需要,並且找出哪些不需要的東西有點混亂。如果有人知道如何去構造這個,那將是完美的。
我有我的導航CSS是:
/* Navigation bar */
#navi {
height: 40px;
width: 961px;
background: #1e416f;
font-size: 14px;
color: white;
text-transform: uppercase;
margin: 0 0 20px 0;
}
#navi a:hover {
background: white;
color: #1e416f;
}
#navi .logo {
margin: 0;
padding: 0;
float: left;
}
#navi .logo a {
float: left;
width: 56px;
height: 40px;
background: url(/imgs/navi/caul_white_nav.png) center no-repeat;
text-indent: -9999px;
}
#navi .logo a:hover {
background: url(/imgs/navi-hover/caul_blue_nav.png) center no-repeat;
background-color: white;
}
#primary-nav, #tools-nav {
list-style: none;
margin: 0;
padding: 0;
}
#primary-nav li, #primary-nav a, #tools-nav li, #tools-nav a {
float: left;
}
#primary-nav a, #tools-nav a {
color: white;
text-decoration: none;
padding: 0 10px;
border-right: 1px solid white;
line-height: 40px;
}
#tools-nav a:hover {
color: #1e416f;
}
#primary-nav li:first-child a, #tools-nav li:first-child a {
border-left: 1px solid white;
}
#tools-nav {
float: right;
}
#tools-nav .icon a {
text-indent: -9999px;
}
#tools-nav .email a {
background: url(/imgs/navi/mail.png) no-repeat scroll center center transparent;
width: 20px;
}
#tools-nav .email a:hover {
background: url(/imgs/navi-hover/hover_mail.png) no-repeat scroll center center transparent;
width: 20px;
}
#tools-nav .twitter a {
background: url(/imgs/navi/twitter.png) no-repeat scroll center center transparent;
width: 20px;
}
#tools-nav .twitter a:hover {
background: url(/imgs/navi-hover/hover-twitter.png) no-repeat scroll center center transparent;
width: 20px;
}
#tools-nav .search a {
background: url(/imgs/navi/search.png) no-repeat scroll center center transparent;
width: 20px;
}
#tools-nav .search a:hover {
background: url(/imgs/navi-hover/hover_search.png) no-repeat scroll center center transparent;
width: 20px;
}
和我有關HTML:
<!-- NAVIGATION -->
<div id="navi">
<h1 class="logo"><a href="#">CAUL/CBUA</a></h1>
<ul id="primary-nav">
<li><a href="#">Directories</a></li>
<li><a href="#">Committees</a></li>
<li><a href="#">Resources</a></li>
<li><a href="#">About</a></li>
</ul>
<ul id="tools-nav">
<li class="login"><a href="#">Log In</a></li>
<li class="email icon"><a href="#">Email</a></li>
<li class="twitter icon"><a href="#">Twitter</a></li>
<li class="search icon"><a href="#">Search</a></li>
</ul>
</div>
我可以看到,這對jsfiddle有效,但如果我將它添加到我的網站而根本沒有任何改變,它就不起作用。唯一可行的是圖像就在那裏。您必須在$(document).ready(function(){.....})之間放置js代碼,以便在網站上使用 –
;並確定你有jquery加載 –
如何讓它擴展到右側而不是左側? –