Disabling copy/select on one image within a page

D

dunk22

Hi, does anyone know how to apply onselectstart and ondragstart to just
one image on a page?

All of the posts I have found so far suggest adding these to the body
tag. The disadvantage of this is that it prevents users from selecting
anything at all on the page.

I need to isolate this to one particualr image. I've tried adding the
selectstarts to divs, the img tag etc but it doesn't seem to work.

I anyone knows how this works, I'd realy appreciate it as it's been
pecking my head for hours!!

Cheers
Dunk
 
J

JustinBlat

While I know this is a little less elegant, perhaps you could show the
image as a background in a div instead of using the img tag:

<div style="background-image: url('myImage.gif'); background-repeat:
no-repeat;">

This may prevent the user from easily selecting the image.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top