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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:37:54+00:00 2026-06-17T06:37:54+00:00

I am using float line menu for my wordpress site, I got THIS FAR

  • 0

I am using float line menu for my wordpress site, I got THIS FAR with some help.

Now my question is how can I make the selected nav float line to be the same color as when you hover over the menu item? At this moment as soon as the mouse is off, it changes into default red.

This is what I’m trying to achieve:

When Menu 1 seleceted (after the click), the float line color should be #0f0

Menu 2 selected – #ee0

Menu3 selected – #05f

Any help is appreciated.

  • 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-17T06:37:55+00:00Added an answer on June 17, 2026 at 6:37 am

    Adding var currentSelected; above var sse1 = function () { and adding currentSelected=k; to the block below

      for (var i = 0; i < a.length; i++) {
                if (url.indexOf(a[i].href.toLowerCase()) != -1 && a[i].href.length > nLength) {
                    k = i;
                    nLength = a[i].href.length;
                }
            }
    

    Will push the index of the current selected list to currentSelected.

    So use it in your customHandleMenu function

    var navigations=[
    /* Nav 1 style */
    {floatColor: '#0f0',
    borderColor: '#0f0'},
    /* Nav 2 style */
    {floatColor: '#ee0',
    borderColor: '#ee0'},
    /* Nav 3 style */
    {floatColor: '#05f',
    borderColor: '#05f'},
    ];
    
    function customHandleMenu() {
      // get nav selector
      var nav = $('#sses1 > ul');
    
      // get float line selector
      var floatLine = $('.highlight'); // .hightlight must exist at this point
    
      // get colors for the current page
      var defaultBGcolor = navigations[currentSelected]["borderColor"];
      var defaultBorderColor = navigations[currentSelected]["borderColor"];
      var defaultNavBorderColor = navigations[currentSelected]["borderColor"];
      // change background-color and border-color on mouseenter event
    
      $('.nav-item-1').on({
        mouseenter: function () {
          setColors({
            floatColor: navigations[0]["floatColor"],
            borderColor: navigations[0]["borderColor"]
          });
        }
      });
    
      $('.nav-item-2').on({
        mouseenter: function () {
          setColors({
            floatColor: navigations[1]["floatColor"],
            borderColor: navigations[1]["borderColor"]
          });
        }
      });
    
      $('.nav-item-3').on({
        mouseenter: function () {
          setColors({
            floatColor: navigations[2]["floatColor"],
            borderColor: navigations[2]["borderColor"]
          });
        }
      }); 
    
        /*
           ...
        */
    
        // put back default colors on the mouseleave event
        $('#sses1 > ul > li').on({
            mouseleave: function() {
              setColors({floatColor:defaultBGcolor, borderColor:defaultNavBorderColor});
            }
        });
              setColors({floatColor:defaultBGcolor, borderColor:defaultNavBorderColor});
    
        function setColors(args) {
            if (typeof args.floatColor != "undefined") {
                floatLine.css('background-color', args.floatColor);
            }
    
            if (typeof args.borderColor != "undefined") {
                floatLine.css('border-color', args.borderColor);
                nav.css('border-bottom-color', args.borderColor);
            }
        }
    }
    

    Live demo | Demo source

    To prevent the Float Line from animating onload, just follow the instructions commented inside the code

    //slip.style.left = items[k].offsetLeft + "px";
    sse1.move(items[k]); //comment out this line and uncomment the line above to disable initial animation
    

    To create:

    slip.style.left = items[k].offsetLeft + "px";
    // sse1.move(items[k]); comment out this line and uncomment the line above to disable initial animation.
    

    Also, you can optionally add

    $('#sses1 li, #sses1 a').on('click',function(){ 
      $('#sses1, #sses1 ul, #sses1 li, #sses1 a').unbind("mouseout");
      $('#sses1, #sses1 ul, #sses1 li, #sses1 a').unbind("mouseleave");
      $('#sses1, #sses1 ul, #sses1 li, #sses1 a').unbind("mouseenter");
      $('#sses1, #sses1 ul, #sses1 li, #sses1 a').unbind("mousein");
      $('#sses1, #sses1 ul, #sses1 li, #sses1 a').unbind("mouseover");
      sse1={};
    });
    

    To your customhandlemenu function, to fully disable any unwanted animations while the page prepares to load.

    Live demo | Demo source

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

Sidebar

Related Questions

Can we make cross browser css layouts with CSS positioning, without using float? What
I'd like to initialize some top-level constants using float::consts::pi . For example: import float::consts::pi;
This project is in Obj-C for iphone. I'm using the double float version of
I'm using this code to attempt to convert a float to an int, then
I've got a question about creating a vertical image sprite menu. Here's my HTML:
I've built a site using the contempt theme (wordpress) and I'm changing it's CSS
I'm trying to develop a drop down menu for a web site. I'm using
I have made menu and centered it using css: margin-left:auto; margin-right: auto; . This
Hallo, I using the following code from css play. this display a menu. .preload16
I am using jquery mega menu plugin and I want to make the right

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.