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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:39:22+00:00 2026-05-12T17:39:22+00:00

Sorry if this was covered before in some way that I wasn’t able to

  • 0

Sorry if this was covered before in some way that I wasn’t able to understand.

I’m somewhat new to JavaScript/Jquery and I normally enjoy wasting hours, fighting my way through things until I figure them out, but my lack of knowledge may be causing me to complicate things where an easier solution unknown to me may be available.

I’ve already successfully implemented JQuery UI Tabs for a portfolio page that switches between two types of designs. I then was able to load each with AJAX, which I liked, although not sure how in my situation it’s beneficial besides separating the content.

I then wanted to switch to using text links instead of the ul.tabs. I’ve always just stripped the style from the tabs to make them appear as basic text links, but I figured there was a more direct way of doing this and wanted to move the links out of the tabbed area, to the sidebar. However, I couldn’t figure out how to make the text links load AJAX.

After trying to figure it out, I wondered if the UI Tabs were even something I needed. I only used them as a way to fade in and out back and forth between two sets of content.

I’m taking a wild guess that there’s a much simpler way for me to be doing this?

Two text links, two html files to be loaded with Ajax, a fade in between changes. That’s all I want.

Here’s how I want the html-

<div id="sidebar">
  <ul>
    <li><a href="ajax/designs1">Designs 1</a></li>
    <li><a href="ajax/designs2">Designs 2</a></li>
  </ul>
</div>
<div id="content">
  This is where stuff will load
</div>

I guess it would also be nice to append a class to the active li a so I could style it differently and give it a text cursor.

Can I do this with just a few lines of of JavaScript/JQuery?

Also, is there a noscript method to load both html files at once if JavaScript is disabled?

Sorry for the ignorance. I will be very happy and grateful for some help.

UPDATE:


I don’t mind the tabs, they are great and very easy to use. I’ve had them controlling my portfolio for a while now. I just know I’m barely using the functionality and it isn’t worth the weight.

This site was down for a while, so I was stuck trying to figure out the code you gave me for myself. I couldn’t get it to work quite like you had it. The append function confused me, I didn’t know what was being appended before the click. But I was able to trial and error my way through it to get it working, almost perfectly for what I wanted, but the fade in and out of the hidden section was all messed up. The visible section was perfect.

Here’s what I came up with. Like I said, I am deep in the learning process so excuse this code if it’s just wrong for whatever reason.

$(document).ready(function(){
        $('#websites').hide();
        $('#hitlogo').addClass("activ");    

        $('#hitlogo').click(function() {
        $(this).addClass("activ");  
        $('#hitweb').removeClass("activ");
        $('#websites').fadeOut(1000);
        $('#logos').fadeIn(1000);
    })

     $('#hitweb').click(function() {
         $(this).addClass("activ"); 
         $('#hitlogo').removeClass("activ");
         $('#logos').fadeOut(1000);
         $('#websites').fadeIn(1000);
    })

});

I gave up trying to fix the issue with the fade and moved onto something else. Though I was pretty proud of myself when I was able to add and remove the classes when each one was clicked so I could style them as I needed.

I quickly just used the code you gave me to load the pages and it seems to be working, I just have to add some fade.

Should the html page that gets loaded in be written up in any specific way? Right now it’s just the group of elements that were inside the original page and nothing else. Viewed on it’s own, there’d be no CSS styling or any other elements. Am I missing something or is this just how it is for those with JS disabled?

I appreciate your help. It’s fun learning. I mastered html and css a while ago and it’s about time I get to learning this now. It’s intimidating as hell at first, but I think I’m slowly starting to grasp the concept.

Thanks again.

  • 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-12T17:39:22+00:00Added an answer on May 12, 2026 at 5:39 pm

    There’s nothing wrong with jQuery UI Tabs… the plugins are supposed to make your life easier.

    Anyway, check out this tutorial on nettuts+ about Ajax tabs. I think you might like it and learn from it as well 🙂

    EDIT: Hmmm… ok I guess I didn’t answer your question. To get a link to load AjAX you just need to bind a click event to it.

    <script type="text/javascript">
    $(document).ready(function(){
     $('#sidebar a').click(function(){
      var url = $(this).attr('href');
      $('#content').load(url,loaded);
      return false;
     })
    });
    function loaded() {
     $('#content').show();
    }
    </script>
    

    Doing it this way also allows your site to work properly if javascript is disabled, since the links will take you to the appropriate page. Without javascript you won’t be able to display both pages at once without using frames.

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

Sidebar

Related Questions

I'm sorry if this was covered before, but I can't find it anywhere on
I ask sorry if this argument has already been covered, but after some research
Sorry, I know that this topic has been covered a bit. I've read the
Sorry if this is a stupid question, but is there an easy way to
Sorry if this question is a bit open ended, but I'm pretty new to
Sorry if this is already covered, or better asked in another of the stackoverflow
im sorry if this has already been covered, i have had a look but
Sorry this is a noob question but if I only need some initial data
Sorry if this has been covered - I've been looking for hours but I
I'm new to JavaScript and programming in general (although I know some people don't

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.