Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 05-19-2010, 11:47 AM Bubble trouble
Junior Talker

Posts: 2
Name: Ryan
Trades: 0
Hi all, first time poster here. I've run into an annoying little problem with an event registration system I've been working on for the past couple days. How I have it set up is a calendar is generated on the page, and days that events are scheduled on are shaded. Clicking anywhere inside the day box will pop up a div near the mouse pointer, with a list of times and events scheduled for that day. Clicking one of the events will populate an input box with the related info.

All of the above is working properly, my problem is that I am trying to find a graceful way to handle closing the day pop ups. The ideal behavior would be to have the div disappear when the mouse exits the div box. My problem is that when I mouseover any of the links inside of the div, because of event bubbling and the fact that I am technically leaving the div and entering a different element, the div will close.

The only thing that has worked so far is using the onmouseleave method, which (obviously) provides the behavior I'm looking for in IE, but does not work in Firefox.

I've done some reading on event bubbling (which was new to me until this problem), but have been unable to implement anything to prevent it.

My question to the community then is, is there some easy way to prevent this event bubling I am experiencing, or is there perhaps an entirely different concept I may have overlooked that would provide the behavior I desire?

I apologize for the long post, trying to be descriptive as possible, hope someone can help!!
RyanL is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-19-2010, 12:20 PM Re: Bubble trouble
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Use the CSS :hover pseudoclass which you can cascade to child elements without the losss of focus problems.

Add the whatever:hover to make IE6 behave.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-19-2010, 01:53 PM Re: Bubble trouble
Junior Talker

Posts: 2
Name: Ryan
Trades: 0
Thanks for your reply Chris I gave it a shot, but did not have any luck, perhaps I was unsure how to implement it how you suggested. I tried a few things, the one that I thought would work was adding something like:

div.event:hover { display: block; }

But that didn't seem to do the trick. Would you be able to provide any further insight on how this might be implemented?

Right now I've just resorted to having a for loop close visible divs before opening a new one, but it seems sloppy.

http://www.thefutureoftheweb.com/blo...e-event-bubble is another resource I've found, I've tried to implement their solution as well, but no luck.
RyanL is offline
Reply With Quote
View Public Profile
 
Old 05-19-2010, 02:15 PM Re: Bubble trouble
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Would you be able to provide any further insight on how this might be implemented?
Quite possibly

But we do need to see your page code first.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Bubble trouble
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13519 seconds with 12 queries