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

The Archive Base Latest Questions

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

You know how you can click on a HTML element, like mainly images, and

  • 0

You know how you can click on a HTML element, like mainly images, and drag a “shadow-version” of them on the screen?

Like see the stack overflow logo? If you click and drag it, you can move a dark version of it around the screen.

So my question is, is there any way to remove the dragging of HTML elements, mainly images?

  • 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-11T10:38:14+00:00Added an answer on June 11, 2026 at 10:38 am

    This is a function of the browser. It’s a shortcut to make saving images to your local hard drive easier. There are three ways to fix or work around this behavior:

    • The best way is to replace the image with a div that has the same width and height of the image, and set the background-image property to the image you want. Backgrounds aren’t draggable, so this will do exactly what you want. For bonus points set the div’s style to display: inline-block; to make it more closely mimic image behavior.

    • The next best thing you can do is make a transparent div the same size as the image, and position it over the image using absolute positioning and z-index. This is messier to maintain, but it might be easier to implement in your layout.

    • The final option sucks. You simply add the following JavaScript to your page somewhere:

      document.getElementById('my-image').ondragstart = function() { return false; };

    …change ‘my-image’ to the ID of your image element, and you’re done. But this option is a bad idea because it relies on Javascript, which not all browsers will have enabled.

    As a footnote, if you’re trying to prevent your images being saved – don’t bother. It’s trivially easy to grab images with or without any amount of clientside protection.

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

Sidebar

Related Questions

I want to know that can mouse click event detects colors or even strings.
You can know if the event stack is empty calling the gtk.events_pending() method, but
I have an HTML document. In that document, there is an element (like button,
I'm automating IE with watir, and I want to know what html element(s) are
I want to click / look at on an html element and find out
As jQuery devs know, jQuery allows easy dynamic HTML creation like this var d
I would like to know if some one can improve my code... Using jQuery
Does anyone know utility which can measure work intensity. For example - keystrokes\mouse clicks
I want to know can we have a JPanel with a Layout other than
This is something I know can be done somehow , because I've done it

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.