Fancybox v2与Durandal无法合作
我无法让Fancybox与Durandal合作。 我使用John Papa的热毛巾模板作为我的起点。
问题:每当我点击图像时,它都会导航到图像路径,而不是将其覆盖在页面顶部。
库:Jquery v 1.9.1和FancyBox 2.1.4。
视图:
视图模型:
define(['services/logger', 'services/dataservice'], function (logger, dataservice) { var vm = { viewAttached: viewAttached, activate: activate, }; return vm; function activate() { //Do something // return promise } function viewAttached() { $(".fancybox").fancybox(); } });
BundleConfig:
bundles.Add( new ScriptBundle("~/scripts/vendor") .Include("~/scripts/jquery-{version}.js") .Include("~/scripts/jquery.fancybox.js") .Include("~/scripts/bootstrap.js") ); bundles.Add( new StyleBundle("~/Content/css") .Include("~/Content/ie10mobile.css") .Include("~/Content/bootstrap.css") .Include("~/Content/jquery.fancybox.css") );
怎么了?
似乎问题出在bootstrap.js v 2.3.0上
Boostrap 2.3.0与fancybox v2不兼容。 我升级到使用bootstrap 2.3.1并解决了我的问题。