I noticed that when I create <img> myself, then the image can be dragged with the mouse and on sites such as the Hashcode avatar cannot be dragged. The question of what it depends on (I know that using js can be used to remove dragging but it wasn’t changed in the cases I mentioned ) can img or not? In Opera and Safari some img are not dragged and in others img dragged on what does it depend on?

For example, on my page my photos in Opera and Safari cannot be dragged, although this is a normal img, can this be due to alt ? Or because of what? After all, when I create img myself, it is dragged! And by the way, I know html css and js very well and I ask what the drag / non-drag <img> tag depends on only in some browsers, without JS and CSS **

  • It is possible, but here it is not necessary to stupidly ask for a function (there is no such), but to think for yourself. I already implemented something similar. Everything works successfully. - AseN
  • Yes, I do not ask a f-tion but WHY sometimes the img is not dragged and sometimes dragged!? - Rules
  • > in Opera and Safari it is impossible to drag And here in firelight it drags all the graphics and avatars as well. What to do? Oh, byad ...)) - Deonis
  • In from I say that only in Opera and Safari! - Rules
  • If everything was as simple as it seems, I would not ask! - Rules

3 answers 3

In Firefox and Opera, all img are moved. If not, then it is prohibited through javascript (checked by turning off in the browser settings).

If you need to prohibit moving images - create an empty layer above each image (http://jsfiddle.net/7soft/xpNat/3/) or use the shurik script. If on the contrary, if you want the image to be dragged, write drag and drop in javascript for browsers that do not support it.

    If the image is displayed through the img tag, then it can be "dragged", and if it is put through the background in the csc, then it is impossible.

    • I know this, but for example on the Hashcode img you can not drag and Js does not control it! - Rules
    • specify what it means to drag img, when and where can they be dragged? - makregistr
    • And why are you minus my question and plyusyaet answer @makregistr because my question is justified (check yourself if you do not believe) and the answer is not in the subject (compare with the question) I am saying IMG TAG IMG with SRC and not background-image and only in some img browsers are not dragged and only under certain conditions, what is the essence of the issue! - Rules

    You can do something like this

    • 1 It does not quite work! (image is dragged in Opera and IE <8) 2 This is not what I need! I ask whether it depends on whether or not the IMG TAG is dragged WITHOUT APPLICATION CSS / JavaScript and only in some browsers! - Rules