/    Sign up×
Community /Pin to ProfileBookmark

click propagate to parent of <img> instead of selecting <img>

Hi, I have a <div> which contains a few <img>’s. When I click/drag the image, I need the <div> behind it to receive the click/drag instead of the <img>, somewhat like the scrolling of Google’s Map. At the moment, the browser treats the drag as dragging the <img>. Is there a way to achieve this? I saw a

“-moz-user-select:none”

post somewhere but it doesn’t seem to work when I apply it to the “#mydiv img” class. Thanks for any help!

[EDIT]: also, what do I need to do to extend this to IE?

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@KorJul 29.2005 — leave a visible border on div and instruct user to drag the div in that area.
Copy linkTweet thisAlerts:
@yilangmokauthorJul 29.2005 — Hm...I could do that but I'd much rather allow the div to be moved even when the img is clicked. Thanks.
×

Success!

Help @yilangmok spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.21,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...