将共享布局中的caroussel与部分视图集成

时间:2016-09-28 13:51:22

标签: javascript jquery asp.net-mvc view

MVC中的新手,我喜欢这个东西:) 我试图通过调用caroussel的控制器及其视图来在共享布局中集成滑块。但它目前似乎不起作用。它在滑块的视图中工作正常(具有未适应的共享布局),但在将其作为局部视图调用时不起作用。 我似乎忽视了一些事情。

是否存在干扰javascript的内容?

这是我的共享布局代码

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
    <script src="~/Scripts/responsiveslides.js"></script>

    <script>
        $(function () {
            $(".rslides").responsiveSlides();
        });
    </script>

</head>

<body>
    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                @Html.ActionLink("Name", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li>@Html.ActionLink("Home", "Index", "Home")</li>
                    <li>@Html.ActionLink("Ons Team", "OnsTeam", "Personeels")</li>
                    <!-- Import partial menu -->
                    @Html.Action("TopNav", "Menu")
                    <!-- End partial menu -->
                    <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
                </ul>
                @Html.Partial("_LoginPartial")
            </div>
        </div>
    </div>
    <!-- Begin Slider -->
    @Html.Action("TopSlider", "Slider")
    <!-- End Slider -->

    <div class="container body-content">


        @RenderBody()
        <hr />
        <footer>
            <p>&copy; @DateTime.Now.Year</p>
        </footer>
    </div>


    @RenderSection("scripts", required: false)

</body>

代码

@model IEnumerable<Project_Assupen.Models.Slider>

<ul class="rslides">
    @foreach (var item in Model)
    {
        <li><img src="@item.ImageFileName" class="rslides"></li>
    }

格雷茨,W

0 个答案:

没有答案