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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:21:04+00:00 2026-05-23T19:21:04+00:00

I have a simple Tab Navigation with jquery. Whenever a new tab is clicked,

  • 0

I have a simple Tab Navigation with jquery. Whenever a new tab is clicked, the script adds to the current navigation list element the class “currentNav” and deletes it from the previous selected list element. Now I want to change the background of the mother ul whenever the second list element gets the class “currentNav”. The start default is that the first list element has this class. My problem is, I don’t know how I can make jquery react on that change..

Here is the html of the navigation

<ul id="AuktionenNav">
                    <li><a class="tabSelect one currentNav" href="#Tab0" rel="0">Auktionen starten</a></li>
                    <li><a class="tabSelect two" href="#Tab1" rel="1">Eingestellte Auktionen</a></li>
                </ul>

And here my jquery so far

if($("ul#AuktionenNav li a.two").hasClass("currentNav")) {
        $("ul#AuktionenNav").css("background-image", "url(../system/css/images/eingestellte_Auktionen.png)")
    }

I appreciate any help! Thx!

  • 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-23T19:21:05+00:00Added an answer on May 23, 2026 at 7:21 pm

    Set a trigger and a bind:

    // When an <li> (NOT the first one) is clicked, tell the <ul>
    $('ul#AuktionenNav li').not(':first-child').click(function(){ 
        $(this).trigger('li_clicked'); 
    });
    
    // When the FIRST <li> is clicked, reset the background
    $('ul#AuktionenNav li:first-child').click(function(){ 
        $('ul#AuktionenNav').css("background-image", "url(../system/css/images/default.png)");
    });
    // Listen for an <li> click
    $('ul#AuktionenNav').bind('li_clicked',function(){
        $(this).css("background-image", "url(../system/css/images/eingestellte_Auktionen.png)");
    });
    

    I know your example only has two <li> tags, but this will scale easily while keeping the first <li> the “resetter”

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

Sidebar

Related Questions

I have a simple jquery tab, which works fine in all browser except ie
Using Rails 3 and jquery, I'm trying to setup a simple 3 tab navigation
I have simple HTML code with some JavaScript. It looks like: <html> <head> <script
I have a very simple code where I use Action Bar with tab fragments.
I have a Tab Bar with a navigation table view. My app crashes when
I have a view based app (not navigation or tab based...) My main view
I have a simple navigation hierarchy: Controller 1 > Controller 2 > Controller 3
Description I have a Tab Bar Controller with a navigation controller tab. The first
I have created a simple UL/LI navigation bar. It looks perfectly fine in both
I have simple regex \.*\ for me its says select everything between and ,

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.