473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

2.0 Menu Difficiency

CMM
The menu control in ASP.NET 2.0 is pretty cool... but there's seems to be a
fairly glaring oversight in it. Only the text is clickable... the
surrounding area of the menu is not clickable even though it responds to
"hover." This is very user-unfriendly and is most noticeable when you orient
the menu vertically and when a menu item has text in it that is considerably
shorter than the other items.

The control uses tables to render the menus... and the HTML for a menuitem
looks like this when rendered:
<td onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)"
onkeyup="Menu_Key(this)" id="Menu1n0">
AFAIK <TD> supports "onlick" so there's no reason why the control omits this
functionality.

--
-C. Moya
www.cmoya.com
Apr 2 '06 #1
6 1083
If the text renders as a hyperlink (and I'm assuming it does) then you
can fix this with a CSS hack - apply a class to your menu and do

..MenuCssClass td a
{
display: block;
}

the entire cell will now be filled by the link's clickable, hoverable,
tool-tippable area. Joy.

Apr 2 '06 #2
CMM
Nice!
Setting this causes IE to honor the "padding: " setting differently... but a
few quick adjustments fixed it. It works well. Thank you!

--
-C. Moya
www.cmoya.com
"Flinky Wisty Pomm" <Pa********@gmail.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...
If the text renders as a hyperlink (and I'm assuming it does) then you
can fix this with a CSS hack - apply a class to your menu and do

.MenuCssClass td a
{
display: block;
}

the entire cell will now be filled by the link's clickable, hoverable,
tool-tippable area. Joy.

Apr 2 '06 #3
CMM
And just to add... this solution makes the problem less noticeable but
doesn't solve it. Unless the menuitem padding is set to 0 there is still an
area that is non-clickable.

Microsoft could easily simply fix this (what I would call a BUG) by emitting
an "onclick" for the menuitem HTML (it's just a nested table) to compliment
the NavigateURL or postback for the Hyperlink... just like it already does
for "onmouseover" and "onmouseout."

--
-C. Moya
www.cmoya.com
"Flinky Wisty Pomm" <Pa********@gmail.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...
If the text renders as a hyperlink (and I'm assuming it does) then you
can fix this with a CSS hack - apply a class to your menu and do

.MenuCssClass td a
{
display: block;
}

the entire cell will now be filled by the link's clickable, hoverable,
tool-tippable area. Joy.

Apr 2 '06 #4
CMM
Well, there's a workaround for that too. Interestingly an Anchor can have
"Padding" as well (I didn't know that)... so if you remove the padding from
the MenuItem class and add it to the anchor class as so:
..MenuCssClass td a
{
display: block;
padding: 6px;
}
It works perfectly and there's only about a one pixel hoverable yet
unfortunately non-clickable area (the border of menu). But the quirk is very
negligable at this point.

--
-C. Moya
www.cmoya.com
"CMM" <cm*@nospam.com> wrote in message
news:eE**************@TK2MSFTNGP10.phx.gbl...
And just to add... this solution makes the problem less noticeable but
doesn't solve it. Unless the menuitem padding is set to 0 there is still
an area that is non-clickable.

Microsoft could easily simply fix this (what I would call a BUG) by
emitting an "onclick" for the menuitem HTML (it's just a nested table) to
compliment the NavigateURL or postback for the Hyperlink... just like it
already does for "onmouseover" and "onmouseout."

--
-C. Moya
www.cmoya.com
"Flinky Wisty Pomm" <Pa********@gmail.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...
If the text renders as a hyperlink (and I'm assuming it does) then you
can fix this with a CSS hack - apply a class to your menu and do

.MenuCssClass td a
{
display: block;
}

the entire cell will now be filled by the link's clickable, hoverable,
tool-tippable area. Joy.


Apr 2 '06 #5
I would guess that the remaining non-clickable area is margin.

try

display: block; height:100%; margin: 0;

and see if that does you any good. Block displayed hyperlinks are
marvellous little beasties for building menus with. Once an element is
block displayed, it will pad/margin/border in the same way as any other
block level element. If you take the block declaration away, it will go
back to behaving as you expect a link to.

Apr 3 '06 #6
CMM
Thank you for the tip. It works beautifully.

--
-C. Moya
www.cmoya.com
"Flinky Wisty Pomm" <Pa********@gmail.com> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
I would guess that the remaining non-clickable area is margin.

try

display: block; height:100%; margin: 0;

and see if that does you any good. Block displayed hyperlinks are
marvellous little beasties for building menus with. Once an element is
block displayed, it will pad/margin/border in the same way as any other
block level element. If you take the block declaration away, it will go
back to behaving as you expect a link to.

Apr 4 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: dr. zoidberg | last post by:
Hello, I'm creating simple menu. MySQL: +----+-----+----------------------+ | id | sid | Title | +----+-----+----------------------+ | 1 | 0 | Main Menu 1 | 2 | 0 | Main Menu 2 | ...
1
by: Macamba | last post by:
Hi all, I am currently developing a website for a voluntary organisation. It is my first step in website development. The dynamic menu I developed has some bugs, which I addressed in another...
2
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at...
1
by: Anthony | last post by:
Below is a script I found at http://javascript.internet.com/ for a cascading menu. The script works great but there is one thing that I would like modified. BecauseI am just learning javascript,...
4
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.