By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,595 Members | 3,721 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,595 IT Pros & Developers. It's quick & easy.

Safari popup menu problem

P: n/a
My simple popup menu code works in IE (Windows and Mac) but not in Safari.

I use a onmouseover ShowMenu function and a onmouseout HideMenu function.

Because Safari, unlike IE, recognises (correctly) text nodes within the
element nodes, the functions run twice as often. If the onmouseover is to or
the onmouseout is to a text node then the functions return false and do
nothing.

But because so many functions are being triggered, if the mouse is moved
quickly, some functions fail to operate and the popup menus either don't
appear of don't disappear.

You can try this at www.brilley.co.uk/TestMenusMac3.asp The popups are
positioned on screen for convenience. Hover on red, move to yellow. The
green popup will appear on Menu1 and Menu2. On Safari, if you move your
mouse up and down the yellow not over the text it works. If you move your
mouse over the text it fails sooner rather than later.

Any ideas very much appeciated.

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Jul 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Roger Withnell wrote:
My simple popup menu code works in IE (Windows and Mac) but not in Safari. [snip] Any ideas very much appeciated.

[snip]

Sorry, no ideas, but I can confirm that it happens with Safari 1.0.3 on
Mac OS 10.2.8. I'm no fan of dynamic menus (I hate them - I can't stand
things that flash at me just 'cos I put the mouse near them).

I also have no idea about opimising DHTML menus, however I haven't
noticed this behaviour with other sites. Can you find another site with
the same type of menus you are trying to build? Does it happen there
too? I tried a couple with single level menus and the work fine, I can't
find any heirachial menus to test.

Cheers, Fred.
Jul 23 '05 #2

P: n/a
If you make sure all the elements that can fire an event have an ID, you can
alter the onmouseover and onmouseout functions so that they only work when
the object firing the event has an ID.

This will work if the nodes within the element (<p>aragraph, <a>nchor,
<font>, etc.) have no ID tag (as they are unlikely to).

If the problem is that the events fire repeatedly, then only react if you
see an ID.

If the problem is that the events don't fire, then recursively work through
the element's parents until you get to and element that does have an ID. The
following code will find the containing element of a text node (assuming the
text node that generated the event is 'element'):

while((!element.id || && element.parentNode && element.parentNode !=
element)
element = element.parentNode;

Hope this is helpful...

Chris.

"Roger Withnell" <ro*********@THISupperbridge.co.uk> wrote in message
news:41**********@127.0.0.1...
My simple popup menu code works in IE (Windows and Mac) but not in Safari.

I use a onmouseover ShowMenu function and a onmouseout HideMenu function.

Because Safari, unlike IE, recognises (correctly) text nodes within the
element nodes, the functions run twice as often. If the onmouseover is to or the onmouseout is to a text node then the functions return false and do
nothing.

But because so many functions are being triggered, if the mouse is moved
quickly, some functions fail to operate and the popup menus either don't
appear of don't disappear.

You can try this at www.brilley.co.uk/TestMenusMac3.asp The popups are
positioned on screen for convenience. Hover on red, move to yellow. The
green popup will appear on Menu1 and Menu2. On Safari, if you move your
mouse up and down the yellow not over the text it works. If you move your
mouse over the text it fails sooner rather than later.

Any ideas very much appeciated.

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Jul 23 '05 #3

P: n/a
In article <41**********@127.0.0.1>,
"Roger Withnell" <ro*********@THISupperbridge.co.uk> wrote:
Any ideas very much appeciated.


Doesn't work in Netscape 7.2 on macos 10.2.6. The window contained the
red, yellow, and green boxes. None of the menus moved over.

In Safari 1.0, the submenus flashed. The submenues where on the screen
when the window came up. When I moved down the red boxes the submenus
moved over. Only on menus one and four did the submenus move over.
Other than that, things seemed to work.

Maybe you could use hvmenu at:
http://www.dynamicdrive.com/dynamici...menu/index.htm

Robert
Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.