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

The Archive Base Latest Questions

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

Below is the code I’m using. Right now the tabs section works fine and

  • 0

Below is the code I’m using. Right now the tabs section works fine and it switched between tabs. The problem is I have a image in a div with a class called “showMem” at the bottom of every tab. That link is supposed to open up the last tab but its not working. The code I got for opening the tab is here JQuery Docs. Any idea? Thank you in advance.

 <script type="text/javascript">
    $(document).ready(function () {

    var $tabs = $('#tabs').tabs(); // first tab selected

        $('.showMem').click(function() { // bind click event to link
            $tabs.tabs('select', 4); // switch to third tab
            return false;
                }).css({
                    cursor : 'pointer'
        });

        var $items = $('#tabs>ul>li');
        var $theImg = $('#tabs>ul>li>a>img');
        $items.click(function () {
            $items.removeClass('selected');
            $(this).addClass('selected');
            if ($items.index($(this)) == 0) { //Intro

                $items.removeClass('tab1Selected');
                $items.removeClass('tab2Selected');
                $items.removeClass('tab3Selected');
                $items.removeClass('tab4Selected');
                $items.removeClass('tab5Selected');
                $(this).addClass('tab1Selected');

            }
            else if ($items.index($(this)) == 1) { //About
                $items.removeClass('tab1Selected');
                $items.removeClass('tab2Selected');
                $items.removeClass('tab3Selected');
                $items.removeClass('tab4Selected');
                $items.removeClass('tab5Selected');
                $(this).addClass('tab2Selected');
            }
            else if ($items.index($(this)) == 2) { //Content
                $items.removeClass('tab1Selected');
                $items.removeClass('tab2Selected');
                $items.removeClass('tab3Selected');
                $items.removeClass('tab4Selected');
                $items.removeClass('tab5Selected');
                $(this).addClass('tab3Selected');
            }
            else if ($items.index($(this)) == 3) { //New Format
                $items.removeClass('tab1Selected');
                $items.removeClass('tab2Selected');
                $items.removeClass('tab3Selected');
                $items.removeClass('tab4Selected');
                $items.removeClass('tab5Selected');
                $(this).addClass('tab4Selected');
            }
            else if ($items.index($(this)) == 4) { //Membership
                $items.removeClass('tab1Selected');
                $items.removeClass('tab2Selected');
                $items.removeClass('tab3Selected');
                $items.removeClass('tab4Selected');
                $items.removeClass('tab5Selected');
                $(this).addClass('tab5Selected');
            }
            var index = $items.index($(this));
            $('#tabs>div').hide().eq(index).show();
        }).eq(0).click();

    });
</script> 



 <div id="tabs" class="ui-tabs">
    <img src="myimage.jpg" />
    <ul class="ui-tabs-nav">
        <li class="tab1"></li>
        <li class="tab2"></li>
        <li class="tab3"></li>
        <li class="tab4"></li>
        <li class="tab5"></li>
    </ul>

    <div id="tabs-1">
       <div class="showMem">image</a>
    </div>
    <div id="tabs-2">
        <p>blah blah blah</p>
        <div class="showMem">image</div>
    </div>
    <div id="tabs-3">
        <p>Blah blah blah </p>
        <div class="showMem">image</div>
    </div>
    <div id="tabs-4">
        <p>blach blah blach</p>
        <div class="showMem">image</div>
    </div>
    <div id="tabs-5">
        <p>blah</p>
        <div class="showMem">image</div>
    </div>
</div>
  • 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-23T17:42:12+00:00Added an answer on May 23, 2026 at 5:42 pm

    I’m not sure if this was a copy and paste error but I found a few things wrong. I pasted your code into JsFiddle, the markup was incorrect, you had some div nesting issues, the anchors were not present in the tabs so they didn’t work

    In some places you start off the image link as a div and finish as a closing ‘a’ tag.

    <div class="showMem">image</a>
    

    You also seem to have tried to implement your own tab system ontop of using the jquery
    UI tabs. This is unnecessary. I would recommend using FireBug if you don’t already. This showed instantly that your markup was wrong. After that it was very straight forward.

    You can see that when you apply jquery ui tabs it adds a number of css classes to your elements. It’s up to you to either include the standard css or write your own classes to make the behavior work. In the JsFiddle I simple tidied up your markup, added some anchors to the tabs to make them work, and added some css to make them look like tabs.

    EDIT

    I also edited your own jsfidde here and added comments to the markup to show you where you were going wrong.

    Hope this helps.

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

Sidebar

Related Questions

My below code works fine and is used to populate a <select> item with
I have the below code in stdafx.h. using namespace std; typedef struct { DWORD
The below code works fine in Win XP til determine the WLAN Card, but
Below code works fine: <?php session_start(); $_SESSION['color'] = 'blue'; class utilities { public static
The below code works fine for only the first click event. However for any
The below code removes certain values from a drop down menu. It works fine
The below code works fine on IE7 but not in Safari(5.0.5). If possible, I
Below code works fine in Firefox, but not in IE8. It triggers mouse click
Below code works fine but it is in the complexity of O(n^2). Is it
The below code is very simple. I have a jQuery autocomplete bound to an

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.