Fancybox を Durandal で動作させることができません。出発点として、ジョン パパのホット タオル テンプレートを使用しています。
問題: 画像をクリックすると、ページの上にオーバーレイするのではなく、画像のパスに移動します。
ライブラリ: Jquery v 1.9.1 & FancyBox 2.1.4。
意見:
<section>
<a class="fancybox" title="Our fresh starters" href="http://www.preschools4all.com/image-files/little-bunny-foo-foo-1.jpg">
<img src="http://www.preschools4all.com/image-files/little-bunny-foo-foo-1.jpg" alt="Our fresh starters" />
</a>
</section>
ビューモデル:
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();
}
});
バンドル構成:
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")
);
どうしたの?