進出口使用的typeahead.js有一個問題,從Twitter的一個新的插件,你可以查看這個插件應該如何看一個例子:http://twitter.github.com/typeahead.js/examples/實施typeahead.js CSS問題
你可以在這裏看到我的實現: http://mypcisbroke.co.uk/problem/
我的問題
- 文本框應該變爲白色焦點
- 建議其自動完成(此安裝插件的工作之前)在文本框應該是較亮的顏色
這裏是我的網站的CSS
.navbar .top-search form { margin: 0 10px 0 0; padding-top: 5px; position: relative; }
.navbar .top-search input, .navbar .top-search button { -webkit-transition: all 200ms ease-in-out; -moz-transition: all 200ms ease-in-out; -o-transition: all 200ms ease-in-out; transition: all 200ms ease-in-out; }
.navbar .top-search input { padding: 2px 24px 2px 10px; border: none; margin: 0; width: 150px; background: #999; -webkit-border-radius: 20px; moz-border-radius: 20px; -ms-border-radius: 20px; border-radius: 20px; }
.navbar .top-search input:focus { background: #f5f5f5; -webkit-box-shadow: none; -moz-box-shadow: none; -ms-box-shadow: none; box-shadow: none; }
.navbar .top-search button { opacity: .6; position: absolute; right: 7px; top: 9px; padding: 0; margin: 0; line-height: 12px; background: none; border: none; -webkit-box-shadow: none; -moz-box-shadow: none; -ms-box-shadow: none; box-shadow: none; }
.navbar .top-search input:focus + button { opacity: 1 }
這是預輸入的造型
.typeahead,
.tt-query,
.tt-hint {
width: 396px;
height: 30px;
padding: 8px 12px;
font-size: 24px;
line-height: 30px;
border: 2px solid #ccc;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
outline: none;
}
.typeahead:focus {
border: 2px solid #0097cf;
}
.tt-query {
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.tt-hint {
color: #999
}
任何幫助,在此將非常感激。
感謝
'!important'應該很少使用 – 2013-02-23 01:10:27
幾乎在那裏,添加重要之後它隱藏了建議?插件似乎創建了一個透明的文本框,這就是爲什麼焦點在技術上仍然在另一個權利? – amof 2013-02-23 01:20:18
看看我的回答,我認爲它會解決透明建議的問題 – 2013-02-23 01:21:05