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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:38:45+00:00 2026-06-11T16:38:45+00:00

So my script works perfectly, but here is the issue, I have buttons (Sprite

  • 0

So my script works perfectly, but here is the issue, I have buttons (Sprite action here) that are 40px height, but the top 20 only shows perfectly. When you click the button ie img the bottom 20px show perfecto! but… Issue, i included in my script a way to return all others to there default (only one should be selected) now, how can I fix this issue that I seem unable to correct as I can select multiple of them ** USERS can switch ** The last part of the script that is the issue. Thanks

$(document).ready(function() {
    $('.form_sub').hide();
    $('.theader').addClass('active');

    $('.theader_t').click(function() {
        $('.form_header').show();
        $('.form_sub').hide();
        $('.theader').addClass('active');
        $('.sub_theader').removeClass('active');
    });
    $('.sub_theader_t').click(function() {
        $('.form_header').hide();
        $('.form_sub').show();
        $('.theader').removeClass('active');
        $('.sub_theader').addClass('active');
    });

    $('.top_head_img').click(function() {
        $(this).css({
            position: 'relative',
            bottom: '20px'
        }).siblings().css(
            'bottom', '0'
        );
    });
});

<ul class="top_head">
    <li>
    <a href="javascript:void(0)" onClick="selectPic5('top');"><img src="custom/images/top2.jpg" alt="Left" border="0" class="top_head_img"/></a>
    </li>
    <li>
    <a href="javascript:void(0)" onClick="selectPic5('center');"><img src="custom/images/mid2.jpg" alt="Center" border="0" class="top_head_img"/></a>
    </li>
    <li>
    <a href="javascript:void(0)" onClick="selectPic5('bottom');"><img src="custom/images/bot2.jpg" alt="Right" border="0" class="top_head_img"/></a>
    </li>
</ul>
  • 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-11T16:38:47+00:00Added an answer on June 11, 2026 at 4:38 pm

    Without very much to go off, this is what I’d suggest: use CSS to do your image sprites.

    Rather than actual image tags, you could use background images on some block link tags (feel free to re-add whatever onClicks you need on these as):

    <ul class="top_head">
       <li>
         <a href="#"></a>
       </li>
       <li>
         <a href="#"></a>
       </li>
       <li>
         <a href="#"></a>
      </li>
    </ul>​
    

    The sprite stuff in the CSS:

    .top_head li a {
        height: 20px; 
        width: 20px;
        display: block;
        background: url(http://lorempixel.com/20/40/abstract) 0 0 no-repeat;
        overflow: hidden; 
        margin: 5px;
    }
    .top_head li a.selected {
        background: url(http://lorempixel.com/20/40/abstract) 0 -20px no-repeat;
    }
    

    ​

    And your click function could we as simple as this:

    $('.top_head li a').click(function() {
        $('.top_head li a').removeClass('selected');
        $(this).toggleClass('selected');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using a script in MatLab that works perfectly fine by itself, but
My script works seemed to be working perfectly well, but Eclipse 3.7.2 was telling
i write a script and it works perfectly, on my local server. I have
I have the following chunk of code. It works perfectly. <div id=restaurant_locations></div> <script type=text/javascript>
What on earth is PHP doing here? This first line works perfectly, but when
I've got a jQuery star rating that works perfectly with jQuery 1.7.2 but returns
The following script below is not running in IE7 but works perfectly fine in
I have the following code which works perfectly but I need an onblur statement
I've been using this script for a long time and it works perfectly in
This script works fine on single click but on double click it shows both

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.