Cloud-Zoom inside Fancybox
Aug 31, 2010 β’ Ole Michaelis
Hey there, I like to translate this post to english, due to this awesome interest.
Today I want to blog some programming stuff, its some time ago I do that. I give my attentaion to the cowork of fanybox and cloud-zoom, booth are jQuery plugins. And to be honest itβs not that hard as it sounds. Letβs go:
Fancybox init:
$(βa.galleryβ).fancybox({
βonCompleteβ : function(arg) {
// Here does the magic starts
$(β#fancybox-imgβ).wrap(
$(ββ)
.attr(βhrefβ, $(arg[0]).attr(βhrefβ))
.addClass(βcloud-zoomβ)
.attr(βrelβ, βposition: βinsideββ)
);
// Thatβs it
$(β.cloud-zoomβ).CloudZoom();
}
});
Now deactivate the boarders in cloud-zoom.css:
/* This is the zoom window. */
.cloud-zoom-big {
/*border:4px solid #ccc;*/
overflow:hidden;
}
Thats it. Have fun!