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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:01:27+00:00 2026-06-04T15:01:27+00:00

I am absolutely beginner in JQuery (but I’ve some knowledge about JS and programming

  • 0

I am absolutely beginner in JQuery (but I’ve some knowledge about JS and programming on other languages)
I have 2 aims:

  1. very simple tabs (or anything for controls), on click with old (active) tab content fading out and then clicked tab content fading in (same place)
  2. same as 1 but with horizontal content slide instead of fading.
    I don’t want JQuery UI, because that is overkill for a simple thing of this kind and I want to learn.

Aim 1, JS:

$(function () {
$("div.tabs > div:gt(0)").hide();
$("div.tabs ul a:first").addClass('selected');

$('div.tabs ul a').click(function () {
$("div.tabs > div").fadeOut('normal', function () {
$("div.tabs > div").fadeIn('slow');
});
$('div.tabs ul a').removeClass('selected');
$(this).addClass('selected');
   return false;
});
});

HTML:

<div class="tabs">
    <ul>
        <li><a href="#first">First</a></li>
        <li><a href="#second">Second</a></li>
        <li><a href="#third">Third</a></li>
    </ul>
    <div id="first">
        <h2>First content</h2>
    </div>
    <div id="second">
        <h2>Second content</h2>
    </div>
    <div id="third">
        <h2>Third content</h2>
    </div>
</div>

How to find active div, instead of poking all divs with $("div.tabs > div") in fadeOut and in fadeIn lines?

Aim2:
I read about slideUp and slideDown but that is vertical, perhaps I’ve to use animate()?
How? If it’s too complicated than it is good for me with vertical slide…

  • 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-04T15:01:28+00:00Added an answer on June 4, 2026 at 3:01 pm

    Aim 1: Just add an active class to the current content div. See demo for altered code.

    Aim 2: There are several techniques to do it w/o jQuery UI, depends on what you want to achieve and where you want to use it. See the altered demo for some sliding effects.

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

Sidebar

Related Questions

I'm thinking about starting to develop a plugin for AutoCAD, but I have absolutely
i m a beginner... i have added two different jQuery... one is pop up
I've always been curious about audio conversion software, but I have never seen a
I'm a beginner when it comes to programming, and I have the nasty habit
I'm an absolute beginner in Outlook programming and Windows GUI programming in general. But
I started using Prestashop yesterday so I’m a total beginner, but I've got some
I'm absolute beginner in web technologies. I know that my question is very simple,
I'm an absolute beginner to programming and i'm just doing some exercises exercises for
Absolute beginner question: I have a template file index.html that looks like this: ...
I am learning Python, following a book (Python Programming for the Absolute Beginner, 3rd

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.