Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:56

Problem with CSS class /w overrides


Poster: ozs
Dated: Tuesday January 25 2005 - 17:22:23 GMT

I just upgraded from 5.12 to 5.691, and have noticed a change in behaviour I can't explain.

With 5.12, the following worked:

Code:
with(menuBarStyle=new mm_style()){
    offclass="menubar-normal";
    ...
    fontweight="bold";
...


That is, I use a CSS class called "menubar-normal" but I also add the bold weight.

This doesn't seem to work anymore (i.e. the bold part is ignored). Is there anything I'm missing?


Poster: Ruth
Dated: Tuesday January 25 2005 - 22:29:04 GMT

Hi ozs,
Do you have a url for us to check out? We'd need to see the css, and the menu_data coding

Ruth


Poster: Ruth
Dated: Tuesday January 25 2005 - 22:52:40 GMT

Hi again, ozs.

I remembered after posting that there was another post with the same problem. It seems that if you now declare class you need to put the fontweight in the class also, however there is another option that might work in the menu. Try using rawcss="fontweight=bold"; in the menu in place of fontweight="bold"; and see if that works.

Ruth


Poster: ozs
Dated: Wednesday January 26 2005 - 14:21:11 GMT

rawcss did fix the problem, but really this is a hack. It is less flexible than the old way, and I believe that this is a bug.

Is there a chance you will be fixing this bug? Currently, I will have to roll back to v5.12 because using the hack all over the place is too time consuming and error prone.

If you still need to see a web site, please email me directly and I will provide you with a login.


Poster: Ruth
Dated: Wednesday January 26 2005 - 15:02:33 GMT

I don't know what you mean by a hack, rawcss is a property of the menu. I don't believe it's a bug, but I will report it. I'm a volunteer so can't answer your question on fixing/or changing this until I get an answer from Milonic. Perhaps you could post your menu data code, the style part and any css codes that are being used on your page here and I could play around with it and see if there's some other solution.

Ruth


Poster: ozs
Dated: Wednesday January 26 2005 - 15:08:09 GMT

Thanks for all your help Ruth. I think your workaround is great for a local fix. But in fact, the menu is ignoring a valid style in the form of <i>fontweight="bold";</i>. This used to work in older versions and there is no reason it shouldn't work in the latest!

I would be happy to provide a link (if necessary) to our intranet site if someone contacts me directly.

-Oz


Poster: kevin3442
Dated: Wednesday January 26 2005 - 20:19:25 GMT

Hello Oz,

I have a few responses:

ozs wrote:
rawcss did fix the problem, but really this is a hack...

Ruth wrote:
I don't know what you mean by a hack, rawcss is a property of the menu.

I don't want to speak out of turn, and I don't want to offend. But I just have to say that I don't think it was necessary to label Ruth's suggestion a "hack" and I hope she wasn't offended by it. I might have been if it had been my suggestion (but Ruth is much tougher than me ;) ). Ruth suggested a legitimate, alternative approach using a legitimate menu property. It wasn't a hack by any definition of the word, and it would require very little modification to the menu_data code to implement. The fact that you thought it was a hack makes me think that you misinterpreted Ruth's suggestion. I base that conclusion in part on the following comments:

ozs wrote:
...It is less flexible than the old way,... using the hack all over the place is too time consuming and error prone.

In a later reply, ozs wrote:
I think your workaround is great for a local fix...

I don't know why you'd find using the rawcss property so much less flexible than using the fontweight property, or why you'd have to apply the change "all over the place" (is that what you meant by "local fix"?). The only explanation I can come up with is that you misinterpreted Ruth's suggestion to mean that you should apply rawcss as a menu item property, in every aI() definition. That would work, but it would require a lot of editing (which is what I assume you meant by "all over the place"). If that's what you thought, then I could understand your feeling about flexibility. But, I don't think that's what Ruth meant. I think she meant for you to apply rawcss as a style property. As with the fontweight property, you can apply rawcss on a per item basis, as an item property, or on a larger scale, as a style property. In fact, most style properties can also be applied as item properties (the main point being to override a global style property on an item-by-item basis). So, to implement Ruth's suggestion, you'd simply replace one line of code with another in the appropriate menu style(s), replacing fontweight="bold"; with rawcss="font-weight: bold";. That doesn't seem inflexible to me. To the contrary, it seems pretty flexible to offer more than one way to do something with relatively little code editing required.

There's another alternative approach (not a hack) that you could try that should also involve very little editing. You posted the following code:
ozs wrote:
With 5.12, the following worked:
Code:
with(menuBarStyle=new mm_style()){
    offclass="menubar-normal";
    ...
    fontweight="bold";
...

Rather than specifying a bold weight in the menu style, you could define it in the class that you're applying. I.e., You could remove fontweight=bold; from your menu style definition, and include font-weight: bold; in your .menubar-normal class definition.

In the first reply, ozs wrote:
...and I believe that this is a bug. Is there a chance you will be fixing this bug?

In a later reply, ozs wrote:
But in fact, the menu is ignoring a valid style in the form of fontweight="bold";.

I see no problem in suggesting that there may have been a bug introduced in recent builds and asking if it might be investigated. I do see a problem with simply asserting that it must be a bug. Certainly some greater testing would have to be done before it is accepted as an actual bug. For example, I'm using the fontweight style property and I have no problem with it. fontweight=bold is working just fine for me in the latest release. I also don't notice a recent increase in other people mentioning problems with the fontweight property. If such a commonly used property went bad, I would expect there to be more reports of it. Yours is the only one I can recall seeing here recently. My point is, maybe there's a bug and maybe there isn't. More testing is required.

ozs wrote:
This used to work in older versions and there is no reason it shouldn't work in the latest!

I can understand your frustration over this. We've all been there at one time or another with various products. However, there may be a perfectly valid reason why your former approach no longer works. For example, it may be that an approach that used to work was never really intended to work that way. I've encountered this sort of thing myself. In your case, maybe using onclass and/or offclass was supposed to preclude the use of other style properties (I'm saying "maybe"... just as an example), but it just so happened that some of those properties still worked. You've gone from 5.12 to 5.69. That's a pretty big leap. Given that fontweight still seems to work for many, if not most users, perhaps it's not a bug in the menu system; perhaps you have some other coding issues that were not apparent with earlier releases of the menu system.

My goal here isn't to irritate you. That may be a side effect, and if I have done so then I apologize. I just wanted to point out that (1) Ruth's suggestion was not a "hack" by any means, (2) There is third approach that you could try using your menu class(es), and (3) It's too early to assume that your particular circumstance represents a bug in the menu system.

To investigate further would require someone to look at as much of your code as can be available. Your offer to let someone into your intranet is appreciated, and it might come to that if you want to pursue it. But as Ruth requested, it may be better to post the pertinent code here first. All of the moderators/Team Members here are volunteers. By posting your code here, it would be available to all of us, as well as to any of the other regulars who might have a suggestion to offer.

Even though I didn't intend to, I realize that I may have offended you, Oz. So it's probably best to point out that my opinions are my own. I am not a Milonic amployee (none of the "Team Members" here are). So, if I've offended you, please let that reflet on me only, and not on anyone else.

Sincerely,

Kevin


Poster: ozs
Dated: Wednesday January 26 2005 - 20:45:05 GMT

I certainly didn't mean to offend by using the word "hack". I think that the word "workaround" is more appropreate. Ruth, if I offended you, I do appoplogize.

As for this being a bug: All I have to go by is the documentation, which doesn't mention that the use of a class i mutually exclusive with use of properties. Also, there is the fact of this working in the older version.

If you scroll back you will see that I started the post asking if it is I who is doing anything wrong here. Later I said that I *believe* that this is a bug.

kevin3442 wrote:
I don't know why you'd find using the rawcss property so much less flexible than using the fontweight property


You are right, they aren't very different. What I am doing is esentially "interiting" styles. Style A isn't bold, B inherits from A and makes fontweight="bold", then C inherits from B and makes it non-bold again. For one override, this isn't a big issue, but if multiple things change between A, B, C, then using rawcss becomes problematic.
(Note that I use "inheriting" in quotations - I am in fact copying and modifying).


Bottom line - Is this a bug? I guess you'll have to tell me. I just hope it goes back to work the way it did :). Regardless, I think you have a great product. Keep on the good work!


Poster: Ruth
Dated: Wednesday January 26 2005 - 21:59:21 GMT

Thanks Ozs,
Ever notice that even those of us who speak the same language end up misunderstanding each other :? :) Where is telepathy when you need it :?: :!:

Ruth


Poster: Andy
Dated: Thursday January 27 2005 - 10:10:37 GMT

Hi All,

This problem has now been fixed for version 5.7 due out soon.

Cheers
Andy