好的,我使用以下CSS成功地使其工作。
.twitter-typeahead {
width: 100%;
position: relative;
}
.tt-dropdown-menu {
width: 100%;
min-width: 160px;
margin-top: 2px;
padding: 5px 0;
background-color: #fff;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.2);
*border-right-width: 2px;
*border-bottom-width: 2px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
}
.tt-suggestion {
display: block;
padding: 3px 20px;
}
.twitter-typeahead .tt-suggestion.tt-cursor {
color: #fff;
background-color: #0081c2;
background-image: -moz-linear-gradient(top, #0088cc, #0077b3);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
background-image: -webkit-linear-gradient(top, #0088cc, #0077b3);
background-image: -o-linear-gradient(top, #0088cc, #0077b3);
background-image: linear-gradient(to bottom, #0088cc, #0077b3);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);
}
.tt-suggestion.tt-cursor a {
color: #fff;
}
.tt-suggestion p {
margin: 0;
}
typeahead.js v0.11.1 更新说明
.twitter-typeahead {
display: inherit !important;
width: 100%;
}
.twitter-typeahead .tt-input[disabled] {
background-color : #eeeeee !important;
}
.twitter-typeahead .tt-input {
}
.twitter-typeahead .hint {
}
.twitter-typeahead .tt-menu {
width: 100%;
max-height: 500px;
overflow-y: scroll;
border: 1px solid #cccccc;
-moz-box-shadow: 12px 14px 30px -7px #616161;
-webkit-box-shadow: 12px 14px 30px -7px #616161;
box-shadow: 12px 14px 30px -7px #616161;
}
.twitter-typeahead .tt-dataset {
}
.twitter-typeahead .tt-suggestion {
padding: 3px 20px;
white-space: nowrap;
}
.twitter-typeahead .tt-empty {
background-color: white;
}
.twitter-typeahead .tt-open {
background-color: white;
}
.twitter-typeahead .tt-suggestion:hover,
.twitter-typeahead .tt-suggestion:focus,
.twitter-typeahead .tt-cursor {
cursor: hand !important;
background-color: #337ab7;
color: white;
}
.twitter-typeahead .tt-highlight {
}