大佬教程收集整理的这篇文章主要介绍了jquery – Bootstrap 3选择切断选项,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
如果我不能通过CSS做到这一点,我打算使用jQuery设置选择框的宽度等于最大选项宽度,如果选项宽度大于选择宽度.
<SELEct class="form-control multiple" size="3"> <option>test123 test123 test123 test123 test123 test123</option> <option>test123 test123 test123 test123 test123 test123</option> </SELEct>
<div class="container"> <div class="row"> <div class="col-xs-12"> <input type="text" class="form-control" value="I am a very,very,very long option. I'm going to extend off the screen."/> </div> </div> <div class="row"> <div class="col-xs-12"> <SELEct class="form-control"> <option value="1">I am a very,very long option. I'm going to extend off the screen.</option> </SELEct> </div> </div> </div>
在这个例子中,如果我们调整窗口的大小越来越小,< input>的宽度.和< SELEct>将调整到容器的大小< div class =“col-xs-12”>.为了防止这种情况,我们需要使用固定宽度的输入,这有点像使用像Bootstrap这样的响应式框架,但我可以在某些情况下看到需要.
一些建议需要考虑:
>是否可以使用较小的选项标签?
>你的< SELEct>在一个最大宽度的容器?
>是否可以使用< modal>如果没有房间,请选择您的选项?
如果所有其他方法都失败了,您可以随时创建自定义类< div class =“col-xs-12 fixed”>并将宽度设置为静态值,可以是基值,也可以是建议使用JQuery查找最长选项值的最大宽度.
希望有所帮助!
以上是大佬教程为你收集整理的jquery – Bootstrap 3选择切断选项全部内容,希望文章能够帮你解决jquery – Bootstrap 3选择切断选项所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。