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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:26:35+00:00 2026-05-26T22:26:35+00:00

I am editing a site that the menu is using a JavaScript. I managed

  • 0

I am editing a site that the menu is using a JavaScript. I managed to have it working but the hover state is just showing in the wrong place.

Here is the link. If you click on “Gallery” it’s the Media that gets highlighted so on the last 3 menu items. Help please.

Here is the JavaScript code:

$(document).ready(function(){
$('#menu .container').each(function(i){
    if(i==0)
    {
        var m = 1;  
    }
    else
    {
        var m = 2;
    }
    $(this).css('width',((m-1)*$(this).parent('li').height() + $(this).parent('li').width())).css('height',$(this).parent('li').height()).css('margin-left',-(m-1)*$(this).parent('li').height()).css('cursor','pointer');

    if(cur_page!=i)
    {
        $(this).find('.slide').html('<img src="' + tpl_base + '/images/menu-slide-' + (i+1) + '.png" />').css('top',$(this).parent('li').height()).css('left',-/*m**/($(this).parent('li').height()));
    }
    else
    {
        $(this).find('.slide').html('<img src="' + tpl_base + '/images/menu-slide-' + (i+1) + '.png" />').css('top','0px').css('left','0px');
    }

    $(this).find('.text').html('<img src="' + tpl_base + '/images/menu-title-' + (i+1) + '.png" />').css('margin-left',(m-1)*$(this).parent('li').height());

    switch(i)
    {
        case 0: var a = url_base + '/bio';
            break;
        case 1: var a = url_base + '/blog';
            break;
        case 2: var a = url_base + '/gallery';
            break;
        case 3: var a = url_base + '/media';
            break;
        case 4: var a = url_base + '/contact';
            break;
        default: var a = url_base;
    }

    $(this).click(function(){
        window.location = a;                       
    });


    var t = $(this).parent('li').height();
    if(cur_page!=i)
    {
        $(this).hover(function(){
            $(this).find('.slide').stop().animate({top:'0px',left:/*-(t*(m-1))*/0 + 'px'}, 200)                    
        },function(){
            $(this).find('.slide').stop().animate({top:t + 'px',left:-(t/**m*/) + 'px'}, 400)                      
        });
    }
});
});
  • 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-26T22:26:36+00:00Added an answer on May 26, 2026 at 10:26 pm

    The highlighting of the menu items appears to be done based on the variable cur_page which is being set incorrectly at some point in the code; here are the values as they sit now:

    Home : cur_page = -1
    Bio : cur_page = 0
    Blog : cur_page = 1
    Gallery : cur_page = 3 // Incorrect
    Media : cur_page = 4 // Incorrect
    

    I would check that this is being set correctly; good luck!

    EDIT:

    In the header of the Gallery page is this:

    <script> 
        var url_base = "http://www.ryansemple.com";
        var tpl_base = "http://www.ryansemple.com/wp-content/themes/semple2010";
        var cur_page = -1;
        cur_page = 3;
    </script>
    

    Change it to this:

    <script> 
        var url_base = "http://www.ryansemple.com";
        var tpl_base = "http://www.ryansemple.com/wp-content/themes/semple2010";
        var cur_page = 2;
    </script>    
    

    A similar fix should take care of the remaining pages.

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

Sidebar

Related Questions

I've got a site that I just published and have just found a bunch
I have a site that uses the jQuery jEditable plugin (inline editing via AJAX).
I'm working on a site, which will have several modules that either fully available
I have a product admin web site that has been generated using ASP.NET Dynamic
I have a site that changes the content of the page when you hover
So I am working on a site for work that I inherited when I
I'm using Ben Nadel's iFrame Upload function for an editing tool on a site
I have a Sharepoint 2007 site that is displaying the old/original title in the
That should be simple web site but with an editable tree. This tree will
I have a wp-network installed with users that can create pages in each site.

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.