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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:38:34+00:00 2026-06-13T19:38:34+00:00

I would like to use the magic line effect seen here on the navigation

  • 0

I would like to use the magic line effect seen here on the navigation for my website. The only problem is I have a vertical nav and this tutorial only explains how to use the magic line on a horizontal nav.

My question (or questions) is:

(1) can the magic line work vertically instead of horzionatally?
(2) how would that be accomplished?
(3) if it can’t be done is there any other way a similar effect can be achieved, specifically for a vertical nav?

Thanks in advance for any help!

  • 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-13T19:38:35+00:00Added an answer on June 13, 2026 at 7:38 pm

    I decided to throw something together for you. It’s far from perfect, but it should get you going in the right direction. I’ve tried to provide decent documentation so you can take this plugin further. I didn’t do too much thorough testing as time’s tight. Hopefully this helps.

    First, the link to the working jsFiddle

    Now, the codes

    /**
     * You can target the .vLine class and change anything you want
     * Core Propreties that should be left untouched are:
         1. top value
         3. position declaration
     * Any other CSS properties should be changed to suit your style.
     * In some cases, you may want to change the left / right values
     * to fit the needs of the position of the vLine
     * simply use $('.vLine').css('left/right', 'value');
     */
    
    
    (function($){
        //define methods of the plugin
        var methods = {
            init: function(options){
    
                //set up some default values
                var defaults = {
                    'side' : 'right'            
                }
    
                //for each element with vLine applied
                return this.each(function(){
    
                    //override defaults with user defined options
                    var settings = $.extend({}, defaults, options);       
    
                    //cache variable for performance
                    var $this = $(this);
    
                    //wrap the UL with a positioned object just in case
                    $this.wrap('<div style="position:relative;width:'+$this.css('width')+';height:'+$this.css('height')+';"></div>');
    
                    //test to see if element exists, if not, append it
                    if(!$('.vLine').length){
    
                        //parent is the ul we wrapped
                        //insert the vLine element into the document
                        $this.parent().append($('<div style="position:absolute;top:'+$this.position().top+'px;height:'+$this.height() / $this.find('li').length+'px;width:3px;" class="vLine"></div>'));                            
                        //do we want to show it on the left or right?
                        if(settings.side = 'right'){
                            $('.vLine').css('right', '0');
                        }else if(settings.side = 'left'){
                            $('.vLine').css('left', '0');
                        }
                    }
    
                    //define the hover functions for each li
                    $this.find('li').hover(function(e){                       
                        $('.vLine').stop().animate({
                            top: $(this).position().top    
                        },200);    
                    }, function(e){  
                       //we want to reset the line if this is met
                       if(['UL', 'LI'].indexOf(e.toElement.tagName) == -1){
                            $('.vLine').stop().animate({
                                top: '1px'
                            });                            
                        }                    
                    });                
                });
            }            
        }
    
        //make it a function!
        $.fn.vLine = function( method ) {
            if (methods[method]) {
                return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));
            } else if (typeof method === 'object' || !method) {
                return methods.init.apply(this, arguments);
            } else {
                $.error( 'Method ' +  method + ' does not exist on jQuery.vLine' );
            }
        };
    })(jQuery);
    
    //on document ready
    $(function(){
    
        //invoke our vLine!
        $('ul').vLine();
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array of Integers in Java, I would like use only a
So, I would like to use this magic find function in my CakePHP 2.0
When I'm working on Android project I would like to use some magic shortcut
I would like to use R to extract the speaker out of scripts formatted
I would like to use Maven's password encryption such as it uses for nodes
I would like to use the logout function from Django but not sure how
I would like to use D3.js (or maybe Raphaël ) for backend-generated reports using
I would like to use the jenkins script console some more. Where do I
I would like to use a pre-commit hook in riak to validate the json
I would like to use GIO (which is part of GLIB) on Android by

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.