好的我已经将css排序了:
现在设置输入框的样式(但这不起作用)任何建议。认为我的js搞砸了。 html元素:
<input name="latLng" class="latLng" id="latLng2" type="text" disabled />
JS:
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('input.latLng').locationPicker({
width: "500px",
height: "20px",
backgroundColor: '#fff',
border: '1px solid #ccc',
borderRadius: 10,
padding: 10
});
});
</script>
我在哪里出错。
答案 0 :(得分:2)
要设置样式,请使用.css()
作为元素样式并单独调用插件,如下所示:
jQuery(document).ready(function(){
jQuery('input.latLng').css({
width: "500px",
height: "20px",
backgroundColor: '#fff',
border: '1px solid #ccc',
borderRadius: 10,
padding: 10
}).locationPicker();
});
或者,有点短:
jQuery(function($){
$('input.latLng').css({
width: 500,
height: 20,
backgroundColor: '#fff',
border: '1px solid #ccc',
borderRadius: 10,
padding: 10
}).locationPicker();
});