Firefox has this annoying behavior that it let’s the user drag and drop any image element by default. How can I cleanly disable this default behavior with jQuery?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
The following will do it in Firefox 3 and later:
If you would prefer not to disable all drags (e.g. you may wish to still allow users to drag links to their link toolbar), you could make sure only
<img>element drags are prevented:Bear in mind that this will allow images within links to be dragged.