/    Sign up×
Community /Pin to ProfileBookmark

event on an element under an element

Hey there. On my web page I have a small span element hidden under a big div element so I can’t trigger the onclick event on the span element. But I want to! Can anybody help me please?

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@KorJul 27.2010 — Hey there. On my web page I have a small span element hidden under a big div element so I can't trigger the onclick event on the span element. But I want to! Can anybody help me please?[/QUOTE]
[I]Under[/I] (the div is absolutely positioned over the span)? Or the span is nested[I] inside[/I] the div, as one of its child nodes? Post the relevant part of the HTML/CSS code.
Copy linkTweet thisAlerts:
@mihicaauthorJul 28.2010 — the div is absolutely positioned over the span

[CODE]<style>
div{
position:absolute;
width:200px; height:200px;
}
span{
position:absolute;
top:20px; left:20px;
width:40px; height:50px;
}
</style>

<body>
<span /> <div />
</body>[/CODE]
Copy linkTweet thisAlerts:
@tirnaJul 28.2010 — [CODE]
<span /> <div />
[/CODE]


This is not how to markup a <span> and a <div> correctly
Copy linkTweet thisAlerts:
@JeroenHoekstraJul 28.2010 — 
[CODE]
<span /> <div />
[/CODE]


This is not how to markup a <span> and a <div> correctly
[/QUOTE]


Indeed it should hav been the other way around. Take a look at http://webdesign.about.com/od/cssglossary/g/bldefnormalflow.htm and http://www.htmldog.com/guides/cssadvanced/layout/ I learned about normal flow at http://www.sceneone.nl/. but it's in Dutch so it wouldn't do you much good.
Copy linkTweet thisAlerts:
@KorJul 28.2010 — Let's take it otherwise: Why do you need to click a span placed under a div? Why did you put it there? Playing with position:absolute is not a wise thing, except when there are strong reasons for that. Which are yours?
Copy linkTweet thisAlerts:
@mihicaauthorJul 29.2010 — Let's take it otherwise: Why do you need to click a span placed under a div? Why did you put it there? Playing with position:absolute is not a wise thing, except when there are strong reasons for that. Which are yours?[/QUOTE]

well i sent a really simple example to this form. but on my actual web page the thing is damn complicated. So calm down and try to find out the solution. and don't ask me anything because i'm going on a holiday for 2 weeks. see ya
Copy linkTweet thisAlerts:
@Declan1991Jul 29.2010 — So calm down and try to find out the solution.[/QUOTE]
Well done, you just minimised your chances of getting the solution.

But I posted because I'd like to see that Dutch site you are talking about, but that link doesn't work.
Copy linkTweet thisAlerts:
@KorJul 29.2010 —  So calm down and try to find out the solution. and don't ask me anything because i'm going on a holiday for 2 weeks. see ya[/QUOTE]
No a wise answer. I still hope that you don't know English quite well.
×

Success!

Help @mihica 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.18,
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,
)...