JP Wolfgang
JP Wolfgang

Reputation: 49

Make image unclickable in jquery

So, I have a bunch of images that do things when you click, and a hand that moves around above these images. I'm using jquery to run a function when the images are clicked. The problem is the hand gets in the way of the images so the hand is clicked rather than the image underneath. I can put the hand behind but it needs to show in front.

Can I make jquery ignore the hand on click events? make it invisible to the mouse? unclickable?

Upvotes: 4

Views: 541

Answers (2)

Sebastianb
Sebastianb

Reputation: 2060

try applying the property pointer-events with the value set to none in the CSS of the hand image:

hand-image-selector{
    pointer-events: none;
}

Upvotes: 3

yezzz
yezzz

Reputation: 3020

Try this css for your hand element:

.thehand {
   pointer-events: none;
}

Browser support: http://caniuse.com/#search=css%20pointer-events

Upvotes: 2

Related Questions