简体   繁体   中英

how to add fancybox to website using visual studio 2012

使用Visual Studio 2012时,在我的网站上创建fancybox时遇到问题。如何将它们添加到一起才能使其发挥最大作用。

I've just added it to my own project, try this:

Tools > NuGet Package Manager > Package Manager Console

In the console type:

Install-Package Fancybox

If you're using MVC you can add this to the bundle config:

        bundles.Add(new ScriptBundle("~/bundles/fancybox").Include(
                  "~/Scripts/jquery.fancybox.pack.js",
                  "~/Scripts/jquery.fancybox-buttons.js",
                  "~/Scripts/jquery.fancybox-media.js",
                  "~/Scripts/jquery.fancybox-thumbs.js",
                  "~/Scripts/jquery.mousewheel-*"));

and add these to your css bundle:

                  "~/Content/jquery.fancybox.css",
                  "~/Content/jquery.fancybox-thumbs.css",
                  "~/Content/jquery.fancybox-buttons.css"

Fancybox can then be instantiate as per the documentation:

<a id="single_image" href="#"><img src="" /></a>

$("a#single_image").fancybox();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM