0

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")
);

どうしたの?

4

1 に答える 1

0

問題はbootstrap.js v 2.3.0にあったようです

Boostrap 2.3.0 は fancybox v2 と互換性がありません。ブートストラップ 2.3.1 を使用するようにアップグレードし、問題を解決しました。

于 2013-05-06T01:58:34.200 に答える