I am not able to get Fancybox work with Durandal. I am using John Papa's Hot Towel Template as my starting point.
Problem: Whenever I click on the image it is navigating to the image path rather than overlaying it on top of the page.
Libraries: Jquery v 1.9.1 & FancyBox 2.1.4.
View:
<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>
ViewModel:
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")
);
What's wrong?