JQuery Mobile - 文本输入不应用样式
JQuery Mobile -Text input does not apply styles
我正在尝试使用 JQuery Mobile 在移动应用程序的文本框中显示文本。我以某种方式让文本框像在桌面上那样显示。样式未应用于文本框。
如果我在 Firebug 中看到,我会看到我得到一个没有样式的空 class
。必须应用此样式- class="ui-input-text ui-body-inherit ui-corner-all ui-shadow-inset"
但事实并非如此。知道我之前是否遗漏了一些应用 js 的东西吗?
@{
Layout = "~/Views/Shared/_MobileLayout.cshtml";
}
@Html.AntiForgeryToken()
<form action="~/Mobile/Register/Complete" method="post" data-ajax="false" id="formId">
<div id="container" style="margin: -6px;">
<div>
<h1 style="margin: 0 0 5px;">Register</h1>
<div class="section">
<h3 style="margin-bottom: 0;">Enter the fields</h3>
<div class="ui-field-contain">
<label for="UserName">Username</label>
@Html.TextBoxFor(m => m.Username, new {@class = "ui-field-contain", style = "width:100%", @readonly = true})
@Html.ValidationMessageFor(model => model.Username)
</div>
</div>
</div>
<div>
</form>
非常感谢,
谢谢,
看
我试图在我的 JavaScript 代码中删除 类 下面的这些:
this.page.find('.ui-shadow-inset').removeClass('ui-input-text ui-body-inherit ui-corner-all ui-shadow-inset');
当我删除上面的代码后,它开始工作并且正在应用样式。
感谢大家的回复
我正在尝试使用 JQuery Mobile 在移动应用程序的文本框中显示文本。我以某种方式让文本框像在桌面上那样显示。样式未应用于文本框。
如果我在 Firebug 中看到,我会看到我得到一个没有样式的空 class
。必须应用此样式- class="ui-input-text ui-body-inherit ui-corner-all ui-shadow-inset"
但事实并非如此。知道我之前是否遗漏了一些应用 js 的东西吗?
@{
Layout = "~/Views/Shared/_MobileLayout.cshtml";
}
@Html.AntiForgeryToken()
<form action="~/Mobile/Register/Complete" method="post" data-ajax="false" id="formId">
<div id="container" style="margin: -6px;">
<div>
<h1 style="margin: 0 0 5px;">Register</h1>
<div class="section">
<h3 style="margin-bottom: 0;">Enter the fields</h3>
<div class="ui-field-contain">
<label for="UserName">Username</label>
@Html.TextBoxFor(m => m.Username, new {@class = "ui-field-contain", style = "width:100%", @readonly = true})
@Html.ValidationMessageFor(model => model.Username)
</div>
</div>
</div>
<div>
</form>
非常感谢,
谢谢,
看
我试图在我的 JavaScript 代码中删除 类 下面的这些:
this.page.find('.ui-shadow-inset').removeClass('ui-input-text ui-body-inherit ui-corner-all ui-shadow-inset');
当我删除上面的代码后,它开始工作并且正在应用样式。
感谢大家的回复