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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:21:05+00:00 2026-06-16T07:21:05+00:00

When using a HTML <button> whenever you press the button it moves a little.

  • 0

When using a HTML <button> whenever you press the button it moves a little. A small animation to show it’s actually a button.

I’m looking for a way to have it stay exactly the way it is, and force my animation using mouse Events.

I started off just placing an <img> and use mouse events to swap the picture. This worked fine, except that it has some side effects I can’t seem to get rid of. For starters, pictures can be dragged, which just looks odd if just press the button – hold – and decide you want to leave the button. I can turn off “draggable” but then it will show a blue square selection box, which is very unwanted.

My solution was to place it on a <button> element instead (with hidden background and border). This solves all the problems, except that it’s slightly wiggling to the side.
I tried disabling it, but that also disables the javascript events.

How can I force a button to stay in place even if it’s clicked?

  • 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-16T07:21:07+00:00Added an answer on June 16, 2026 at 7:21 am

    So you have to use another tag than button (for instance span) and manipulate it’s behaviour with javascript.

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

Sidebar

Related Questions

I have a cancel button in a form: @using (Html.BeginForm(ConfirmBid,Auction)) { some stuff ...
I have ASP.Net code generating my button's HTML for me using divs to get
i have html form i am using <a href="#" onclick="document.aa.submit()"> instead of submit button
I'm adding HTML controls dynamically using java script. For instance, I have one button
I'm having a little trouble setting a form using inner HTML: document.getElementById(Button).innerHTML='<form action=add.php method=post
I have a little javascript function using datepicker in the following way: function sanchobonanzaandtheballisticballcrunch()
I am using the HTML button tag but the style mentioned below should only
I've created a button using HTML/CSS and a Java script. The button should direct
I've 2 asp listbox controls and an html input button, and using js i
In my .NET project I'm using a Button in HTML page that brings a

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.