Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Fancybox Lightbox
- $('a[href*="youtu"]').each(function(){
- if($(this).attr('href').indexOf('somna') !== -1 || $(this).attr('href').indexOf('band') !== -1 || $(this).attr('href').indexOf('/channel/') !== -1 || $(this).attr('href').indexOf('/user/') !== -1){
- // Don't affect links to channel/user pages
- }else{
- $(this).attr('data-fancybox','video-gallery');
- }
- });
- $('a[href*="vimeo"]').each(function(){
- if($(this).attr('href').indexOf('somna') !== -1 || $(this).attr('href').indexOf('band') !== -1 || $(this).attr('href').indexOf('/channel/') !== -1 || $(this).attr('href').indexOf('/user/') !== -1){
- // Don't affect links to channel/user pages
- }else{
- $(this).attr('data-fancybox','video-gallery');
- }
- });
- $('a[href*=".jpg"],a[href*=".jpeg"],a[href*=".png"],a[href*=".gif"]').attr('data-fancybox','gallery');
- $('.gallery-item a').attr('data-fancybox','gallery');
- var imageTitle,imageAlt;
- $('a[href*=".jpg"],a[href*=".jpeg"],a[href*=".png"],a[href*=".gif"],a[data-fancybox]').each(function(){
- imageTitle = '';
- imageAlt = '';
- imageTitle = $(this).find('img').attr('title');
- imageAlt = $(this).find('img').attr('alt');
- if($(this).attr('data-caption') === ''){ // Don't replace existing captions
- if(typeof imageTitle !== 'undefined' && imageTitle !== ''){
- $(this).attr('data-caption',imageTitle);
- }else if(typeof imageAlt !== 'undefined' && imageAlt !== ''){
- $(this).attr('data-caption',imageAlt);
- }
- }
- });
- $.fancybox.defaults.loop = true;
- $.fancybox.defaults.smallBtn = true; // Use the small inline close button rather than relying on the toolbar
- $.fancybox.defaults.animationEffect = 'zoom';
- $.fancybox.defaults.transitionEffect = 'tube';
- $.fancybox.defaults.buttons = [
- 'zoom',
- 'share',
- 'slideShow',
- 'fullScreen',
- 'download',
- 'thumbs',
- 'close'
- ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement