/    Sign up×
Community /Pin to ProfileBookmark

Making a div hidden….?

I’ve been experimenting with layers and I made a div that I can drag around. The problem I’m having is to get it to close (set visibility to hidden) when the user clicks their mouse off of it – In other words, the equivalent of a window closing when losing focus. Since “onblur” (the perfect solution) is not supported for a div (exception being IE) is there something else that will emulate the “onblur” event handler for a div using javascript?

Thanks…

Mike

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@BonRougeJun 09.2005 — How about 'onmouseout' ?
Copy linkTweet thisAlerts:
@Mike_BurdickauthorJun 09.2005 — BonRouge,

Thanks for responding!

That would work but I would like them to click outside of it to close it or it would close automatically like the "onblur" event handler works for a window. I guess what I should have asked: Is there a way to emulate the "onblur" function via a script?

Mike
Copy linkTweet thisAlerts:
@BonRougeJun 09.2005 — Just a thought, but would something like this work for you? : http://bonrouge.com/test/hide.htm
×

Success!

Help @Mike_Burdick 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.5,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...