我已经在我的博客中实现了kendo combobox,但是当我第一次进入网页或刷新页面时,宽度加载非常懒,我的意思是我已经在外部插入宽度代码我的意思是减少框的宽度 这是我插入代码的代码,但之后我得到了结果但是加载非常懒,你可以在blog
中看到<style>
.k-combobox{
width: 225px !important;
}
</style>
<style>html { font-size: 14px; font-family: Arial, Helvetica, sans-serif; }</style>
<link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.2.607/styles/kendo.common-material.min.css" />
<link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.2.607/styles/kendo.material.min.css" />
<link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.2.607/styles/kendo.default.mobile.min.css" />
<script src="//kendo.cdn.telerik.com/2016.2.607/js/jquery.min.js"></script>
<script src="//kendo.cdn.telerik.com/2016.2.607/js/kendo.all.min.js"></script>
<div id="example" role="application">
<div id="tshirt-view" class="demo-section k-content">
<h4 style="margin-top: 2em;">Search</h4>
<select id="size" placeholder="Select size..." style="width: 100%;" >
<option />Vijay <option />Kumar
<option />Software
<option />Gamer
<option />Businessman
<option />Thats all
</select>
</div>
<script>
$(document).ready(function() {
// create ComboBox from input HTML element
// create ComboBox from select HTML element
$("#size").kendoComboBox();
var select = $("#size").data("kendoComboBox");
});
</script>
</div>
<style>
.k-combobox{
width: 225px !important;
}
</style>
&#13;
答案 0 :(得分:0)
在此更改代码:
<script>
$(document).ready(function() {
$("#size").hide();
// create ComboBox from input HTML element
$(window).load(function(){
$("#size").show();
$("#size").kendoComboBox();
var select = $("#size").data("kendoComboBox");
});
// create ComboBox from select HTML element
});
</script>