简体   繁体   中英

typeahead on bootstrap 3

Currently I'm using this typeahead but it display like this:

在此输入图像描述

Ist possible to display the typeahead, same width as the input ?

What I tried so far is:

.dropdown-menu {    
    display: block; position: static; width: 100%; 
}

But this break the lower fields

在此输入图像描述

Check my fiddle

UPDATE:

I tried both of @neel shah and @shin solution and this is the result. I don't know why in the fiddle is not looking this way

在此输入图像描述

Try this . Hope it helps.

.dropdown-menu { width: 100%; }

UPDATE: Check this out.

The problem is with position: static you just need to remove it from the css

Check this FIDDLE

.dropdown-menu { display: block; width: 100%; }
$('.typeahead').typeahead({})
on('typeahead:opened',function(){$('.dropdown-menu').css('width',$('.typeahead').width() + 'px');});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM