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 7618495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:25:07+00:00 2026-05-31T03:25:07+00:00

I have a custom formatTitle for jQuery Fancybox. I need show next and prev

  • 0

I have a custom formatTitle for jQuery Fancybox. I need show next and prev buttons and span like that “Image 1 of 4”. So, I have done it, but if I have just one image it is still shows “Image 1 of 1” and buttons too, it is not good looking. I have tried to do ‘if else’ statements for current index, but if I have more than one image – buttons are not showing and “Image 1 of 4” and when you are clicking next it’s start shown. Please, see the code:

function formatTitle(title, currentArray, currentIndex, currentOpts) {
    if(currentIndex == 0) {
        return '<div id="custom-title"><span><a href="javascript:;" onclick="$.fancybox.close();"><img src="/data/closelabel.gif" /></a></span>' + (title && title.length ? '<b>' + title + '</b>' : '' ) + '</div>';
    } else {
        return '<div id="custom-title"><span><a href="javascript:;" onclick="$.fancybox.close();"><img src="/data/closelabel.gif" /></a></span>' + (title && title.length ? '<b>' + title + '</b>' : '' ) + '<span><a href="javascript:;" onclick="$.fancybox.prev();">prev</a> <a href="javascript:;" onclick="$.fancybox.next();">next</a></span> Image ' + (currentIndex + 1) + ' of ' + currentArray.length + '</div>';
    }
}

And here is the link
Anybody help please?

  • 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-05-31T03:25:08+00:00Added an answer on May 31, 2026 at 3:25 am

    You need to ask if currentArray.length==1.

    Your question gives all times true because when the page load the index is zero.

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

Sidebar

Related Questions

I have a few models that need to have custom find conditions placed on
I have custom drupal module. I receive result from a webservice that I need
I have custom exceptions in my django project that look like this: class CustomFooError(Exception):
I have custom groupViews that need to change state when they are expanded and
I have custom SPlist with some fields that I'd like to bind to a
I have custom styled input submit buttons. I have a background image and then
I have Custom List to display image with it's name like below... public class
I have custom validators and filters that I have created that I would like
I have custom classes that I currently instantiate within App.xaml as resources. I want
i have custom cell with 2 buttons(the function of these buttons is just to

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.