Question is already been asked in title.
Here is a code:
(function($){
var filter = /(.*)(\.jpg|\.png|\.gif|\.bmp)$/i;
$('a > img').each(function(){
var href = $(this).parent().attr('href');
if ( filter.test(href) ){
$(this).fancybox({
transitionIn:'fade',
transitionOut:'fade',
overlayShow:true,
overlayOpacity:0.7,
overlayColor:'#e8f1fa'
});
}
});
})($);
So, as you can see, the aim in that to set up a fancybox on a sequence “a > img”, where “A” tag have link on an image.
Here is a problem place: http://factorial.wispo.ru/novosti/skoro-budet-sajt.html
The answer is easy – it needs to specify the fancybox on the “A” tag. So, there is a fix: $(this).parent().fancybox(… Thanks for focus and HAD