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

  • Home
  • SEARCH
  • 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 8205235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:09:28+00:00 2026-06-07T08:09:28+00:00

I am working on a Gallery section which has Photos & Video section. I

  • 0

I am working on a Gallery section which has Photos & Video section.

I Every thing is fine with the photo gallery & it is working fine. example: Photo Gallery URL http://tinyurl.com/bsqd5lp

In photo gallery i am using 'titleFromAlt': true, to pass the title using alt tag. alt tag has customized title example <span>2012-07-02</span><br><span>Department of Tourism</span>

I want to do same for the video galley but i cant achieve this using 'titleFromAlt': true,. The way i doing it is not good as it show the title when one hover over the image as HTML code. Example: Video Gallery URL http://tinyurl.com/bsdq694

Other issue i have with this is the title of the video come in center. I tried to change the CSS so that title will be left aligned.

.fancybox-title-float {
    position: absolute;
    left: 0;
    bottom: -20px;
    height: 32px;
    float:left;
}

For some reason i am not able to overnight the above code even if i place this after displaying image.

Help this is regard in appreciated.

UPDATED:

code for you tube videos

$(document).ready(function () {
    $(".youtube").click(function () {
        $.fancybox({
            'padding': 0,
            'autoScale': false,
            'transitionIn': 'none',
            'transitionOut': 'none',
            'title': this.title,
            'titleFromAlt': true,
            //'titlePosition': 'over',
            'width': 680,
            'height': 495,
            'href': this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
            'type': 'swf',
            'swf': { 'wmode': 'transparent', 'allowfullscreen': 'true' }
        });
        return false;
    });
});
  • 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-07T08:09:29+00:00Added an answer on June 7, 2026 at 8:09 am

    One thing that we have overlooked is that for your videos you are using the manual method via .click() and not the regular way to bind fancybox to a selector via .fancybox()

    In this scenario – using .click()– the titleFromAlt option won’t work, however you still can set the fancybox title from the alt attribute stored in your img tag using a regular jQuery expression.

    so try this script

    $(document).ready(function () {
        $(".youtube").click(function () {
         // first, get the value from the alt attribute
            var newTitle = $(this).find("img").attr("alt"); // NEW
            $.fancybox({
                'padding': 0,
                'autoScale': false,
                'transitionIn': 'none',
                'transitionOut': 'none',
              //'title': this.title, // we will replace this line
                'title' : newTitle,  //<--- this will do the trick
              //'titleFromAlt': true,  // we don't need this anymore
              //'titlePosition': 'over', 
                'width': 680,
                'height': 495,
                'href': this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
                'type': 'swf',
                'swf': { 'wmode': 'transparent', 'allowfullscreen': 'true' }
            });
            return false;
        });
    });
    

    … assuming that you have an alt attribute in the img tag.

    Sorry for the confusion and all the comments back and forth.

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

Sidebar

Related Questions

I have a small self made gallery which im still working on it: http://springbreak.enteratenorte.com
I am working on creating an image gallery which has thumbnails in different sizes.
I have a Gallery view in my application which is working fine. When clicking
I'm currently working on a gallery to my photos. Besides some bugs, I'm finished
I am working on a photo gallery, each thumbnail is in its own DIV
I have a photo gallery I am working on building, and I have a
I'm working on an app that behaves like a photo gallery, and I'm implementing
I'm working on an app that behaves like a photo gallery, and I'm implementing
I'm working on a gallery, which use jQuery Lighbox 2 ( plugin page ).
I'm working on a photo gallery, and I would like the ability to 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.