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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:39:57+00:00 2026-06-10T11:39:57+00:00

I have a client site with a navigation feature that has been very tightly

  • 0

I have a client site with a navigation feature that has been very tightly designed (and not by me):

Slideshow Navigation

It consists of an unordered list, with three DIVs in each list item:

<ul id="application-tabs">
   <li>
      <div class="cv-home-applications-slideshow-tab-first"></div>
      <div class="cv-home-applications-slideshow-tab"><h4>Coffee</h4></div>
      <div class="cv-home-applications-slideshow-tab-right"></div>
   </li>
   <li>
      <div class="cv-home-applications-slideshow-tab-left"></div>
      <div class="cv-home-applications-slideshow-tab"><h4>Pet Food</h4></div>
      <div class="cv-home-applications-slideshow-tab-right"></div>
   </li>
</ul>

The content is in the center DIV, while the first/left and right DIVs create the angled tab buttons.

This client has also requested a Google Translate utility up at the top of the page.

My problem is that I need the navigation element to always fill that space from end to end. If the translation produces a shorter word – such as “Cafe” instead of “Coffee” – I need it to expand accordingly.

Likewise, if it results in a longer word, like “Cerveza,” I’ll need the font size to reduce.

I’m sure I’ll need to employ some javascript, in combination with the CSS, but I’m not entirely sure where to start. Any assistance would be appreciated.

Thanks,

ty

  • 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-10T11:39:59+00:00Added an answer on June 10, 2026 at 11:39 am

    here is a fiddle of a solution, it automatically spaces the menu to fit http://jsfiddle.net/nFRjc/

    var $j = jQuery.noConflict();
        $j(document).ready(function () {
            var containerWidth = $j('#application-tabs').width();
            var linksWidth = 0;
            $j('#application-tabs li div + div').children().each(function () {
                linksWidth += $j(this).width();
            });       
            var linkSpacing = Math.floor((containerWidth - linksWidth) / ($j('#application-tabs').children('li').length));
            $j('#application-tabs').children().not(':last-child').css('margin-right', linkSpacing + "px");
        });​
    

    Ok simple solution to make the font reduce in size if it’s too large. See this fiddle, the links font size are 100px, but the script reduces them until they fit. http://jsfiddle.net/nFRjc/2/ I just added a loop that checks whether or not the total width of the individual links is greater than the container width, and reduces the font size by 1 if true.

    var $j = jQuery.noConflict();
        $j(document).ready(function () {
            var containerWidth = $j('#application-tabs').width();
            var linksWidth = 0;
            $j('#application-tabs li div + div').children().each(function () {
                linksWidth += $j(this).width();
            });
            while (linksWidth >= (containerWidth - 100)) {
                $j('#application-tabs li div + div h4').css({'font-size': '-=1'});
                var linksWidth = 0;
                $j('#application-tabs li div + div').children().each(function () {
                    linksWidth += $j(this).width();
                });
            }
            var linkSpacing = Math.floor((containerWidth - linksWidth) / ($j('#application-tabs').children('li').length));
            $j('#application-tabs').children().not(':last-child').css('margin-right', linkSpacing + "px");
        });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a client who has built her entire site using html extensions. As
I have been working on a site for a client and I am about
I have a request for a client who has three level of navigation and
I have a site I designed for a client which is primarily used by
I have to create a site definition for a client that must contain pre-defined
I have a client with a site (built with Kohana framework) which has a
Possible Duplicate: @font-face not working on a client site? I have the following font
We have a client whose site is hosted on a server (I don't want
Ok, so I have to do some work on a client site - and
I have a client with an event planning site asking his pages to fade

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.