伙计们我是MVC的小伙伴,但过去曾使用Jquerymobile而没有任何问题。我的项目是一个带有Jquerymobile 1.3.0的MVC 4 c#。它有一个菜单面板,但不向上或向下滚动。面板打开很好,关闭很好。我还注意到网页(视图)也不会向上或向下滚动。然而,这是有趣的事情,使用Windows Phone 8一切都运行良好,正确滚动面板和页面。这是我难倒的地方。这是我的Layout.cshtml中的代码,感谢您提供的任何帮助...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title </title>
<!-- <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" /> -->
<meta name="viewport" content="user-scalable=no, initial-scale=1, width=device-width" />
@Styles.Render("~/Content/jquery.mobile.structure-1.3.0.min.css")
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
<div data-role="page" data-theme="d" tabindex="0" class="ui-page ui-page-active">
<div data-role="panel" id="mypanel" data-theme="a" >
<!-- panel content goes here -->
<div class="ui-panel-inner">
<ul data-role="listview" data-inset="true" data-divider-theme="a">
<li data-role="list-divider">Messages</li>
<li><a href='@Url.Action("GetMessages","Message",new { MyUserId = "6" })'>My Messages</a></li>
<li><a href='@Url.Action("MsgSchool","Message",new { MyUserId = "6" })'>Send Msg to School</a></li>
<li><a href='@Url.Action("MsgStudent","Message",new { MyUserId = "6" })'>Send Msg to Student</a></li>
<li data-role="list-divider">Events</li>
<li><a href="#">My Events</a></li>
<li><a href="#">Add an Event</a></li>
<li data-role="list-divider">Schedule</li>
<li><a href="#">Schedules</a></li>
<li><a href="#">Add Schedule</a></li>
<li data-role="list-divider">Video</li>
<li><a href="#">My Videos</a></li>
<li><a href="#">Add a Video</a></li>
<li data-role="list-divider">Organization</li>
<li><a href="#">Schools</a></li>
<li><a href="#">Add a School</a></li>
<li data-role="list-divider">User</li>
<li><a href="#">Students</a></li>
<li><a href="#">Add Students</a></li>
</ul>
<p>To close, click off the panel, swipe left or right, hit the Esc key, or use the button below:</p>
<a href="#" data-rel="close" data-role="button" data-theme="c" data-icon="delete" data-inline="true" data-corners="true" data-shadow="true" data-iconshadow="true" data-wrapperels="span" class="ui-btn ui-shadow ui-btn-corner-all ui-btn-inline ui-btn-icon-left ui-btn-up-c">
<span class="ui-btn-inner">
<span class="ui-btn-text">Close panel</span>
<span class="ui-icon ui-icon-delete ui-icon-shadow"> </span>
</span>
</a>
</div>
</div><!-- /panel -->
<div data-role="header" data-theme="d" >
<a href="#mypanel" data-role="button" data-inline="true" data-mini="true" data-corners="true" data-shadow="true" data-iconshadow="true" data-wrapperels="span" data-theme="c" class="ui-btn ui-shadow ui-btn-corner-all ui-mini ui-btn-inline ui-btn-up-c"><span class="ui-btn-inner"><span class="ui-btn-text">Menu</span></span></a>
</div>
<div id="themessages"></div>
@RenderBody()
</div>
@Scripts.Render("~/Scripts/jquery-1.8.2.min.js")
<script>
$(document).on("mobileinit", function () { $.mobile.ajaxEnabled = false; });
</script>
@Scripts.Render("~/Scripts/jquery.mobile-1.3.0.min.js")
@Scripts.Render("~/bundles/jquery")
<script>
$(document).ready(onDeviceReady);
</script>
@RenderSection("scripts", required: false)
</body>
</html>
这是一个视图
@model Mobile.Models.Message
@{
ViewBag.Title = "Message";
}
<div data-role='content' class='ui-content' role='main'>
<h2>Send Message to Student</h2>
@using (Html.BeginForm("SendTheMsg", "Message", FormMethod.Post))
{
<ul data-role="listview" data-inset="true">
<li data-role="fieldcontain">
@Html.DropDownListFor(p => p.SendToID, new SelectList (Model.UserList, "UserId", "FName"), "Select Student", new { id = "UserId", Class = "dropdownstyle" })
</li>
<li data-role="fieldcontain">
<label for="msgbodyuser">Message Body:</label>
<textarea cols="40" rows="3" name="msgbodyuser" id="msgbodyuser"></textarea>
</li>
@Html.Hidden("senderid", Model.SentBy)
@Html.Hidden("appid", Model.AppId)
@Html.Hidden("msgAction", "POSTUSER")
<li class="ui-body ui-body-b">
<fieldset class="ui-grid-a">
<div class="ui-block-a"><button type="button" onclick=" goBack() " data-theme="d">Cancel</button></div>
<div class="ui-block-c"><button type="submit" id="userinfosave" data-theme="a">Send</button></div>
</fieldset>
</li>
</ul>
}
</div>