使用jQuery进入MVC3 View [英] useing jQuery into MVC3 View

查看:73
本文介绍了使用jQuery进入MVC3 View的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

各个团体。

我有问题。我将创建一个照片库。为此我使用jQuery Cycle Plugin。我下载jQuery表单这个

并将它添加到我的.js文件到Scripts文件夹中。

这是我在剃刀中的视图:

hi every body.
I have a problem . I will to create a photo gallery.for this I use jQuery Cycle Plugin.I download it jQuery form this
and add it to my .js files into Scripts folder.
this is my View in razor:

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <link href="@Url.Content("~/Content/ftdLightBlue/styless.css")" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.cycle.all.js")" />
    <script type="text/javascript">
        $(function () {

            $('#pics').cycle({ fx: 'scrollDown',
                speed: 300, timeout: 2000
            });

        });
    </script>
</head>
<body>
    <div class="pics">
        <img alt="" src="/Content/Chapm.jpg" />
        <img src="/Content/e9wxteygkihq25wgvsi.jpg" alt="Champions of Europe" />
        <img src="/Content/1200.jpg" alt="Champions of Europe" />
    </div>
</body>
</html>





但是当我运行app时,我看到这个视图只显示图像。为什么这个功能不起作用?

谢谢。

好​​的。

你可以在这里看到JQuery: http://malsup.github.io/jquery.cycle.all.js [ ^ ]

推荐答案

(function(){
(function () {


' #pics')。cycle({fx: ' scrollDown'
speed: 300 ,timeout: 2000
});

});
< / script >
< / head >
< body>
< div class = pics >
< img alt = src = / Content / Chapm.jpg />
< img src = / Content / e9wxteygkihq25wgvsi.jpg alt = 欧洲冠军 />
< img src = / Content / 1200.jpg alt = 欧洲冠军 />
< / div >
< / body >
< / html >
('#pics').cycle({ fx: 'scrollDown', speed: 300, timeout: 2000 }); }); </script> </head> <body> <div class="pics"> <img alt="" src="/Content/Chapm.jpg" /> <img src="/Content/e9wxteygkihq25wgvsi.jpg" alt="Champions of Europe" /> <img src="/Content/1200.jpg" alt="Champions of Europe" /> </div> </body> </html>





但是当我运行app时,我看到这个视图只显示图像。为什么这个功能不起作用?

谢谢。

好​​的。

你可以在这里看到JQuery: http://malsup.github.io/jquery.cycle.all.js [ ^ ]


你的div有一个名为pics的类,但你正试图通过ID访问它您需要将其更改为: -




your div has class with name pics but you are trying to access it by id you need to change it as:-



这篇关于使用jQuery进入MVC3 View的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆