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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:04:13+00:00 2026-06-02T21:04:13+00:00

I hope you guys can help me with this. The navigation, tabmenunav has 3

  • 0

I hope you guys can help me with this.

The navigation, tabmenunav has 3 small dots at the bottom of the tabs, I need to calculate the height of each tab and position them at the bottom. at the moment are all in position absolute and doesn’t look good.

Demo:
http://jsfiddle.net/QxgDr/24/

Jquery

(function tabszIndex() {

$('ul.tabmenu > li > a').each(function(e) {
    $("#tabmenunav").append("<a href='javascript:void(0);' class=''>&#8226;</a>");
});

$('ul.tabmenu > li > a').click(function(e) {
    var selectedTabIndex = $(this).parent().attr('id').substring(3); //parseInt(this.hash.substring(4));
    $('ul.tabmenu a').removeClass('active');
    $(this).addClass('active');
    $('#tabmenunav a').removeClass('active');
    $('#tabmenunav a').eq($(this).parent().index()).addClass('active');
    var i = 0;
    $('.tabmenu li').css('z-index', function(index) {
        var z = index < selectedTabIndex ? 1 : (index > selectedTabIndex ? --i : 0);
        return z
    });
    e.preventDefault();
});
$('#tabmenunav a').click(function() {
    var idx = $(this).index();
    $('> a', $('ul.tabmenu > li').eq(idx)).trigger('click');

})
var lastTabIndex = $('.tab').length - 1;
$('.tab').each(function(i) {
    if (i != lastTabIndex) {
        $(this).append("<a href='javascript:void(0)' class='next-tab mover'>Next Tab &#187;</a>");
    }
    if (i != 0) {
        $(this).append("<a href='javascript:void(0)' class='prev-tab mover'>&#171; Prev Tab</a>");
    }
});
var tabMenu = $('.tab');
$('.next-tab, .prev-tab').click(function() {
    var newTabIndex = $(this).hasClass('next-tab') ? 1 : -1;
    var idx = (parseInt($(this).parents('li').attr('id').substring(3)) + newTabIndex);
    $('ul.tabmenu > li#tab' + idx + ' > a').trigger('click');
});
$('> a', $('ul.tabmenu > li').eq(0)).trigger('click');

})();

  • 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-02T21:04:14+00:00Added an answer on June 2, 2026 at 9:04 pm

    One of the first things that came to mind was the use of offset(). Documentation. You can use that to both capture the location of an element and then turn around and use that to set the location of another element. I have used this technique to modify your jsfiddle here.

    Here is what I added:

    var offsetGoal = $("#Overview").offset();
    $("#Features").offset({ top: offsetGoal.top, left: (offsetGoal.left+100) });
    $("#Technical").offset({ top: offsetGoal.top, left: (offsetGoal.left+200) });
    

    Perhaps that will work for you.

    Edit: Oops, I just noticed that you were asking about shifting the three small dots. I came up with the following to adjust their position which you might find useful.

    I decided to calculate the number of li elements that you have in your menu (assuming you eventually have more) and multiply that by a set number of pixels to adjust by.

    // However many elements in our tab menu should reinforce how far down to shift the navigation elements.
    var shiftDotsBy = $(".tabmenu>li").size() * 3;
    // Find the current position and just shift it downward
    var dotsCurrentPos = $("#tabmenunav").offset();
    $("#tabmenunav").offset({top: (dotsCurrentPos.top+shiftDotsBy), left: dotsCurrentPos.left});
    

    Working example.

    Edit: This jsfiddle has been updated and shifts the dots based on which tab has been clicked and their relative height difference. Here is the approach:

    // tab index is one-based; assuming each tab is twenty pixels lower than the previous one
    var shiftDotsBy = (selectedTabIndex - 1) * 20;
    var dotsCurrentPos = $("#tabmenunav").offset();
    // Based on the original position of the dots determined outside this event, shift the dots by how far each tab extends down
    $("#tabmenunav").offset({top: (dotsOrigPos.top+shiftDotsBy), left: dotsCurrentPos.left});
    

    Taking these ideas you should have lots of control over how you want your dots to appear and shift around.

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

Sidebar

Related Questions

This has been doing my head in. Hope you guys can help. I can't
I hope some of you guys can help me with this problem.... I have
I hope you guys can help me with this one. So, I have a
I have a question that i hope you guys can help me with! This
Hope you guys can help me. This is my situation. I have a stored
Hello StackOverflow Community, I hope you guys can help me with this here: On
I'm really confused so I hope you guys can help me. I know how
I've run in to a problem I hope you guys can help me with.
First time stackoverflow user but occasional lurker, hope you guys can help me out.
Couldn't find a better place to ask this so I hope you guys can

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.