Wijmo 表单装饰器下拉列表和按钮样式问题
我们已经开始使用 Wijmo (基于 jQuery UI 和 jQuery UI 主题滚轮)在我们的一个应用程序上,但 Wijmo 表单装饰器样式中的下拉列表和按钮有问题。
我查看了 Wijmo 文档,但它们没有帮助。
我们已经启动了脚本并应用了样式,但是在所有表单上我无法使下拉项与其他元素正确对齐。
启动脚本如下:
<script id="scriptInit" type="text/javascript">
$(document).ready(function () {
$(":input[type='text'],:input[type='password'],textarea").wijtextbox();
$("select").wijdropdown();
$(":input[type='radio']").wijradio();
$(":input[type='radio']").wijcheckbox();
$("button").button();
});
</script>
您会注意到 .button()
和 .wijdropdown()
函数应用于标签的每个实例,而不是类或 ID - 我们对所有 3 种方法都遇到同样的问题,并且已经采取了这种方式,因为这是整个应用程序所期望的。
您可以在此处查看问题的屏幕截图:
我一直在使用 Firebug 来尝试找出问题所在问题是,我怀疑部分原因是 Wijmo 将 select
元素转换为 div
并应用 JS 来启用 select
功能。
我一直在使用 Firebug 和 Chrome 开发人员工具来调试此问题,我注意到任一元素的上方或下方都没有应用边距。
我已经删除了除 Wijmo 或 ThemeRoller 以外的所有其他样式表,但没有任何变化。我们正在使用 Wijmo 附带的“火箭”主题。
每次我尝试操作其中一个的 margin-top
属性时,它都会重新对齐与正上方的 input
搜索字段内联的所有元素。
表单的 HTML 代码是:
<FORM id="serialSearch" name="serial_search" method="POST" action="index.php">
<label>Serial number: </label><input type="text" name="query" id="query" size="30" autocomplete="off" value="<? echo $serial_query; ?>" />
<br />
<select name="searchType">
<option value="standard">Standard</option>
<option value="fuzzy">Fuzzy</option>
</select>
<button>Search serial numbers</button>
<input type="hidden" name="serial_submit" id="serial_submit" value="search_serials" />
</FORM>
正确对齐对我们来说非常重要,并感谢任何建议,提前致谢。
We have started using Wijmo (based on the jQuery UI & jQuery UI Theme Roller) on one of our applications but have a problem with the dropdown and button in the Wijmo Form Decorator styling.
I have had a look at the Wijmo Docs but they haven't been helpful.
We have initiated the script and the style is applied however on all forms I cannot get the dropdown item to align correctly with other elements.
The initiation script is as follows:
<script id="scriptInit" type="text/javascript">
$(document).ready(function () {
$(":input[type='text'],:input[type='password'],textarea").wijtextbox();
$("select").wijdropdown();
$(":input[type='radio']").wijradio();
$(":input[type='radio']").wijcheckbox();
$("button").button();
});
</script>
As you will notice the .button()
and .wijdropdown()
functions are applying to each instance of the tag versus a class or an ID - we have the same problem with all 3 methods and have gone this way as this is what is desired through the entire application.
You can see a screenshot of the problem here:
I have been using Firebug to try and work out what the problem is and I suspect part of it is that Wijmo converts the select
element into a div
and applies JS to enable the select
functionality.
I have been using both Firebug and Chrome developer tools to debug this, I notice that there is no margin being applied either above or below either element.
I have removed all other stylesheets that are not Wijmo or ThemeRoller but no change. We are using the "rocket" theme that comes with Wijmo.
Each time I try and manipulate the margin-top
property on either it realigns all elements that are inline with the input
search field directly above.
The HTML code for the form is:
<FORM id="serialSearch" name="serial_search" method="POST" action="index.php">
<label>Serial number: </label><input type="text" name="query" id="query" size="30" autocomplete="off" value="<? echo $serial_query; ?>" />
<br />
<select name="searchType">
<option value="standard">Standard</option>
<option value="fuzzy">Fuzzy</option>
</select>
<button>Search serial numbers</button>
<input type="hidden" name="serial_submit" id="serial_submit" value="search_serials" />
</FORM>
It is really important for us to get this aligning correctly and appreciate any suggestions, thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要将所有表单元素包装在一个 div 中,假设有一个“input”类,并将此样式应用于 div 元素:
在这里你可以看到一个jsfiddle,它显示了它的样子。
作为建议,下次创建一个 jsfiddle 而不是屏幕截图,这样人们和您都可以更轻松地测试您的代码。
you need to wrap all the forms elements inside a div with let's say a class "input" and apply this style to the div elements:
here you can see a jsfiddle that shows how it looks like.
as a suggestion, next time create a jsfiddle more than a screenshot so it's easier for people and for you to test your code.