【发布时间】:2014-12-22 18:02:05
【问题描述】:
我正在尝试诊断在移动设备上滚动时遇到的问题。我不知道在哪里看,但我认为这可能是我在项目中使用的脚本/css。正在发生的问题是,在移动设备上,滚动就像在桌面上一样。当我向上或向下滚动时,我没有看到“滑动”的视图。
我的捆绑配置
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.UseCdn = true;
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/respond.js"));
bundles.Add(new ScriptBundle("~/bundles/amplify").Include(
"~/Scripts/amplify.js"));
bundles.Add(new StyleBundle("~/Content/bootstrap").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));
// Set EnableOptimizations to false for debugging. For more information,
// visit http://go.microsoft.com/fwlink/?LinkId=301862
BundleTable.EnableOptimizations = true;
}
}
我的布局
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Learn ASP.NET MVC</title>
<link href='http://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'>
<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
@Styles.Render("~/Content/bootstrap")
</head>
<body>
<!--- --->
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@Scripts.Render("~/bundles/amplify")
@RenderSection("scripts", required: false)
</body>
</html>
是否有任何原因导致它无法正确加载?这是一个新的开箱即用的 asp.net mvc 项目。
【问题讨论】:
-
看不到滑动视图是什么意思?也许截图会有所帮助。
-
是的,在 iPod(或任何移动设备)上滚动时,视图不会滑动。默认情况下,在 iOS 应用程序中,您拥有不错的“滑动”功能。滑动的速度带有动量,您会看到东西在屏幕上滑动。在 iOS 的音乐应用中,当您向上或向下滑动时,您的视图会滚动 - 正是这里缺少这种效果
-
那么当您现在尝试滚动时会发生什么?没有动力吗?顺便说一句,您所说的通常称为“动量滚动”
-
它没有动力。项目建成时,它做到了。现在,当您浏览此处时,它已经消失了:learnaspnetmvc.azurewebsites.net
标签: jquery css asp.net asp.net-mvc