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

  • Home
  • SEARCH
  • 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 6192853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:01:02+00:00 2026-05-24T03:01:02+00:00

so i am a begginer and i really need help so i wrote this

  • 0

so i am a begginer and i really need help
so i wrote this function down here;
the objective was to take as parameters an element name , a div tag selector and a php file address,

function navigation($nav,$container,$link)
{ 


 $($nav).click(function(){
    $($container).slideUp(500,function(e){
    $(this).append("<span>");
    $(this).load($link);
    });
  });
  {
  $($container).ajaxComplete(function(){
  $(this).slideDown(500);
});
  }
  {
    $($container).slideUp(500);
  }
}

the usage is simple

    navigation("#home",".content","home.php");
   navigation("#about",".content","about.php");
    navigation("#store",".content","right.php");

the html is just a few <div> one with class=".content" tag and <a> links called #home #about #store the pages in php are just plain html inside them;


now the problem is when i click the link it works but i can find how to make he active link unclickable after it becomes active
and i was about to do a sublist with the same function trying to load a little div under the navigation links that contain links but i cant find how to do
any one of pro’s have any idea ???

  • 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-24T03:01:05+00:00Added an answer on May 24, 2026 at 3:01 am

    I can help but it’s going to be quite a rewrite.

    Firstly, give all your navigation items a class. Inside the nav items (I don’t know if they’re div, li elements or whatever, put an <a> tag with the src set to the page you want the navigation to load. When done it might look something like below:

    <ul id="navigation">
        <li class="nav">
            <a src="home.php">HOME</a>
        </li>
        <li class="nav">
            <a src="about.php">ABOUT</a>
        </li>
        <li class="nav">
            <a src="right.php">RIGHT</a>
        </li>
    </ul>
    

    Then use jQuery’s onload functionality to bind the click event onload, rather than calling your navigation function 3 times. You grab the src from the child <a> tag of the li clicked.

    $(function()
    {
        $('.nav').click(function()
        {
            if($(this).hasClass('active'))
            {
                return false;
            }
            $(this).siblings('li').removeClass('active');
            $(this).addClass('active');
    
            $('.content').slideUp(500).load($(this).children('a').attr('src'), 
                null,
                function(){$(this).slideDown(500);}
            );
            return false;
        });
    });
    

    Note the return false; is important to prevent the default action of the link (i.e. sending the user to the other page).

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

Sidebar

Related Questions

this is a really basic question I know, I am a begginer in Haskell.
Im new at tkinter so im a begginer.. I need help because i was
I'm begginer in Java. Can you help me to find error? I run this
Excuse me if this is a silly question but i'm a beginer here. I
i'm just a begginer in perl, and very urgently need to prepare a small
I'm in my first time with DDD, so I'm begginer! So, let's take it's
So I am super new to this, and am not really sure what I
I'm making a Grade log application and I have this piece of code here
I am very sorry if I ask a wrong question but I really need
I've already got this to work but it's a really bad approach and i

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.