View Full Version : DD Mega Menu - adjustment of a mega menu width doesn't work at all while another four

01-21-2018, 10:03 PM

Adjustment of a mega menu width doesn't work at all while another four on the same page work well. You can find the page at http://www.ehyeh.com/ehyehindex-toFIX.html. The problem mega menu is the first menu 'News'. I changed the value of the width in style attribute
<div id="menu0" class="mega" style="width;520px"> variously but it did not respond at all. I wonder what is the problem.
And I have one more problem, i.e. the 11th list of the 'drop down / mega' menu which starts with 'Guinea' doesn't work for escaping the special character '-', the actual item of it is 'Guinea-Bissau'. I replaced the '-' with Non Break Hyphen HTML code but it doesn't work as christian-marriage.net in the second menu, betterlife-insurance.com in the third menu,
o-jerusalem.com in the fourth menu and the-quasar-3c-273.com in the fifth menu work. These four are escaped from the line break, showing proper format. But in the first menu it only escapes with Non Break Space as shown in the first list, i.e. THETOP.NEWS - 'Save your time'.


01-21-2018, 10:13 PM
style="width;520px"should be

01-21-2018, 10:42 PM
style="width;520px"should be

I expected what you exactly expected as it is a simple mistake. I changed it but surprisingly it doesn't work! I'm wondering why.. And what about the escaping the special character problem ?

Thanks Arie,

01-22-2018, 11:21 AM
Maybe there's something in the script that overrides the style that you give to menu0, so try
As for Guinea-Bissau, I don't know what you mean (what I see in the menu is Guinea-Bissau).

01-22-2018, 11:44 PM
Thanks for your reply.

I tried but it didn't work too. I think the problem is due to the first menu has its submenu. The other four don't have the submenu. So the problem is possibly the script problem. Can you check it for me?
For Guinea-Bissau issue it appears not escaping special character mode on Chrome which I have used to use. I wonder why it happens on only the first menu but not the other.


01-23-2018, 04:09 AM
It does work. I checked with 'width:520px' but not with variation, i.e. '620px' etc. I was somewhat hurry. My apology.
I'm willing to give you a gift of $50 on letting me know the code for escaping the special characters including an image (specifically down.png) and where I have to put the code in the script, if you would like to. I think 'encodeURIComponent()' method can be used for it but I'm not sure.


01-23-2018, 11:53 AM
Maybe I understand now what you mean regarding the difference between Guinea-Bissau on the one hand, christian-marriage.net and betterlife-insurance.com etc. on the other. You are using − in Guinea-Bissau, and ‑ in the other cases. Use ‑ in all cases.
Does this solve your hyphenation problem?

01-23-2018, 02:36 PM
Thanks, Arie.
Second common error! It works.
And I have to correct the somewhat 'Messi' mistake i.e. 'encodeURIComponent()' method.
I think something like
String.prototype.escapeHTML = function() {
return this.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "'");
} will work for replacing/escaping the special characters (but not sure for the image) as you must know well.
I can discuss this matter at the 'Paid Help' section if you would like to.

Thanks again.

01-23-2018, 07:41 PM
Hello Naremkin,
You could put it at the Paid Help section, but I don't do paid jobs. Maybe someone else is willing.
This being said, I still don't understand what you say about the difference between Guinea-Bissau and christian-marriage.net, for example. The format is exactly the same
in both cases we have ‑
Guinea‑Bissau vs Christian‑marriage.net.

Another thing I don't understand is why you need a javascript encodeURIComponent() function. This function is used in javascript strings (info at https://www.w3schools.com/jsref/jsref_encodeURIComponent.asp), but the text on your site is normal HTML plus HTML-entities, so why would you need it?

Or do you just want to get rid of the HTML-entities and write normal HTML, where the hyphens must prevent a line break though? Then use '-' and put this on your page:

function replace_hyphen() {
for (i = 0; i < document.body.innerHTML.length; i++) {
document.body.innerHTML = document.body.innerHTML.replace("-", "‑");

01-24-2018, 07:49 PM
Hi! Molendijk,

Thanks for your kind reply.
I wrote "Second common error! It works." due to I forgot to change '−' to '‑' after some trials so I meant it was common error and it was fixed after I changed it. [I don't know how to show the hyphens to the entity code.]
Well, however, I have struggled with the script though it was not essential for my problem. The essential problem is the line breaking with '-' '&' 'space' and, I thought, the image 'down.png' (but it is not, but the actual problem was the 'submenu link').
I tried with the code, You can view the result at http://gigabitsisp.com/ehyeh/ehyehindex-toFIX-TrialScript.html.
And I tried to resole the line breaking problem but I have not find the solution yet. The followings are the trials.
Without submenu : http://http://gigabitsisp.com/ehyeh/ehyehindex-toFIX-1.html
With submenu with the triangle: http://gigabitsisp.com/ehyeh/ehyehindex-toFIX.html
With submenu without the triangle: http://gigabitsisp.com/ehyeh/ehyehindex-toFIX-0.html

I wonder how can I resolve the line breaking problem with the submenu link.

Thanks again,

01-24-2018, 09:26 PM
I think I'm beginning to unserstand what you're after. Apparently, you don't want a line-break in a sequence like aaaaaaaaaaaaaaaaaaaaaaaaaaaa - bbbbbbbbbbbbbbbbbbbbbb, whatever the position of the sequence or the width of the window. There's a simple way to achieve this. Just use:

* {white-space: nowrap}
and put '-' instead of '‑' in your document. (Also, you don't need '&nbsp;' anymore for the sole purpose of avoiding line-breaks).
Now, this may not work perfectly if the part before and / or after the hyphen ('-') is a block element. Somewhere in the source of your page I saw something that seems to force a-elements and span-elements to behave like block elements (which cause line-breaks!). Undo this by adding a, span {display: inline-block!important} to your document.
To be short, try this:

* {white-space: nowrap}
a, span {display: inline-block!important}
and put it at the end of the head section. Also, replace all '‑' width normal hyphens ('-').

01-25-2018, 05:01 AM
Thanks for reply.

I tried it but it didn't work. Please view the following pages.
Well, however, I'm willing to give you a gift of $50 regardless of this line breaking matter due to the width widening matter was quite crucial for my site, if you would like to. Please let me know how to give it to you.


01-25-2018, 11:23 AM
You haven't removed ‑ yet. For instance, Guinea‑Bissau can be safely replaced now with Guinea-Bissau or Guinea - Bissau.
There's really no need for a gift. Thanks anyhow.

01-26-2018, 06:24 AM
I was expecting a magic but it didn't happen.
You can view this at http://gigabitsisp.com/ehyeh/ehyehindex-toFIX-TRIAL.html.
I can use the multi-column menu instead of it though there is a little restriction on the multi-column. However the reason why I can use the multi-column in comfort manner is that the width widening matter was resolved in '!important'. So you don't have to concern this line-breaking matter further. I've given you a 'Thanks'.


02-19-2018, 04:16 AM
Hello! Arie,

I made one of my domains, http://www.homepageclinic.com, forwarded one of your webpages, http://www.let.rug.nl/~molendyk/menustwinhelixlistmenu/index.html, in appreciation of your help and http://www.websiteclinic.net forwarded to dynamicdrive.com in appreciation of this site. It will be last for a while. If both of you don't want it I would change it. Please let me know if you don't want. And I'm willing to let you use these two domains in some conditions if you want to.