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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:51:15+00:00 2026-05-26T09:51:15+00:00

I have a <button> with a nested image and I’m using jQuery to toggle

  • 0

I have a <button> with a nested image and I’m using jQuery to toggle the image src attribute on mousedown and mouseup. When the button is clicked in IE8 the image moves down and right 1 pixel, as buttons do in IE, but then it sticks there and won’t return to its original position. If I remove the mouseup event the button functions normally, but of course my js button behavior breaks.

In googling the issue I have found another bug that causes a button with a CSS background to move up and left when active, but then return. My button gets stuck, and only when there is a mouseup event registered.

The markup looks like this:

html:

<button type="button" id="sdbSearchButton" title="Zoom to this room">
    <img id="sdbSearchButtonImg" src="images/control_play.gif" />
</button>

CSS:

label.sdbAttr button {
    float: left;
    background-color: white;
    border: none;
    outline: none;
    margin-left: 5px;
    padding: 0px;
    height: 16px;
    width: 16px;
}

javascript:

$('#sdbSearchButton').mousedown(function(e) {
    $(this).children().attr('src', 'images/control_play_blue.gif');
    searchForSpace();
}).mouseout(function() {
    $(this).children().attr('src', 'images/control_play.gif');
}).mouseup(function() {
    $(this).children().attr('src', 'images/control_play.gif');
});
  • 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-26T09:51:15+00:00Added an answer on May 26, 2026 at 9:51 am

    Why are you using an img?

    button {
    background-image: url('img1')
    }
    button:active {
    background-image: url('img2')
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a button on an ASP.NET wep application form and when clicked goes
We have a button that saves asynchronously using AjaxToolKit/C#/.NET. I'm getting this in my
I have two panels and a button nested within an hbox. I want the
Suppose I have a button nested in the Template of a ListBoxItem , can
I'm trying to close a parent container when an internally nested button is clicked.
I have button, which fires an event, that deletes a record from the database.
I have one issue with Datetime Picker In my firstview i have button.If i
I have one issue with UInavigationcontroller In my firstview i have button.If i click
I have a button that I would like to disable when the form submits
I have a button on an ASP.Net page that will call Response.Redirect back to

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.