Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8568229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:03:56+00:00 2026-06-11T18:03:56+00:00

I am using fancyBox 2, and I am using the thumbnail helper. When I

  • 0

I am using fancyBox 2, and I am using the “thumbnail helper.” When I have images in my gallery, fancyBox automatically uses the target images for thumbnails, but when I link to a video (Vimeo, in my case), it does not generate a thumbnail. I thought this would be easily remedied by just specifying an image for fancyBox to use for the video link, but I don’t know how to do this.

On the website, http://fancyapps.com/fancybox/, it says that there is a “source” option for the thumbnail helper, which should be used like this to enable thumbnails, and set source:

$(".fancybox").fancybox({
    helpers:  {
        thumbs : {
            source : 'img/~~~.jpg'
        }
    }
});

But of course, that can’t work, because how could I specify which thumbnail to use for which target image or video? I can’t find any working examples of the thumbnail helper being used with videos, or custom thumbnails. Thank you in advance for any help.

EDIT:

The “source” option is described as a “function to obtain the URL of the thumbnail image”. I am trying to figure out how to use it. I am thinking of something like

source: item.thum

where I have a “thum” attribute for the thumbnail source in each item that I am referencing, such as

$.fancybox.open([
    {href : 'image1.jpg', thum : 'thumb1.jpg'},
    {href : 'image2.jpg', thum : 'thumb2.jpg'},
    {href : 'image3.jpg', thum : 'thumb3.jpg'}],
    {helpers : {
        thumbs:{source:this.thum}
    }   }
)

Would it be something like this? Can you see what I mean? How would I actually make that work? As you can see, I am not a speaker of JavaScript.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:03:57+00:00Added an answer on June 11, 2026 at 6:03 pm

    I made it work like this: my function found all items whose href element contained the string http://vimeo, and replaced those entire hrefs with the url of the thumbnail image I am using for the videos.

    I had to learn about regular expressions, too, to make it work.

    $(".fancybox").fancybox({
        helpers : {
            thumbs : {
                source: function( item ) {
                    return item.href.replace(/http:\/\/vimeo.*/gi, 'img/vimeo.jpg');
        },
    });
    

    Actually, I also have an HTML file in an iFrame in my gallery as well, and I wanted to give that its own thumbnail, too, so my final product was:

    $(".fancybox").fancybox({
        helpers : {
            thumbs : {
                source: function( item ) {
                    return item.href.replace(/http:\/\/vimeo.*/gi, 'img/vimeo.jpg')
                    .replace(/.*html/gi, 'img/html.jpg');
        },
    });
    

    For anyone who finds this thread, and wants to see an example of this in practice, here is a link to the site where I used it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have any one tried to activate fancybox thumbnail gallery using a button or an
I have set up a link to an image using fancybox but when I
I'm using fancybox to show some images in a gallery. I have a main
I'm using Fancybox 1.3.4 with ASP.NET MVC 3. I have following link : <a
I've been using Fancybox for years, but it seems things have changed with some
I'm using the Jquery Fancybox to display a gallery of images in a c#
I'm using FancyBox, and I want to make a gallery without thumbnails on the
I did video overlays using fancybox. but the problem is some of my videos
I am using fancybox on a series of gallery images. The user has the
We are using Fancybox to provide a lightbox for our image gallery. We have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.