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:42

Conflict with a DHTML script from dynamic drive.


Poster: spaceman
Dated: Saturday February 21 2004 - 10:22:31 GMT

Hi All,

Firstly - just have to say that I'm blown away by Milonic v.5. Speaking from the perspective of a php/mysql developer, the new menu_data.js is going to be a doddle to dynamically build. Excellent work.

Secondly - whilst I may be pretty handy with php/mysql, my javascript is not so crash hot, and I have a problem. The Milonic v.5 code is conflicting with some existing DHTML code in an existing website. The code in question is the 'Fade-in slideshow' which is found here: http://www.dynamicdrive.com/dynamicinde ... deshow.htm. The 'Fade-in slideshow' code sits in a single location inside the body tag.

The clash is not 'fatal'. I'm trying to get my v.5 Milonic menu to appear centered with 100% width. It does this just fine for the entire site (AKAIK) except for the (home) page that includes the Fade-in slideshow script. The effect of the conflict is simply that the Milonic menu ceases to be centered or 100% width. It reverts to left-aligned and default width.

Can anyone give me a leg-up here and advise me what I should be doing or looking for in order to resolve this conflict? Duplication of function names? Worst case - the fade-in slideshow will have to go!

Thanks in anticipation. :-)


Poster: John
Dated: Saturday February 21 2004 - 17:58:59 GMT

You didn't give us a URL to your site so we can see the failure. A link to DD doesn't help!

Thanks for the kind words about the menu. We agree :!:


Poster: spaceman
Dated: Sunday February 22 2004 - 0:07:42 GMT

The site I'm working on is this one:

http://www.thewoolshack.com

BUT the introduction of a new menu system using Milonic v.5 is still under development on a local web server (ie. not live). So by all means take a look at http://www.thewoolshack.com, but (at time of writing) you'll only see the old menu system there together with the fade-in slideshow effect.

Thanks for your reply and sorry I'm not yet making your help very easy! I'm quite happy to investigate further myself if perhaps you can help me by indicating in general terms the most likely cause of a clash between one DHTML script and another.


Poster: Ruth
Dated: Sunday February 22 2004 - 8:37:59 GMT

If it's possible for you to put up a page someplace it might help the guys. I have that script on my site and it works fine. I just retested in Netscape 4.79, 6.1, 7.1; Opera 6.05, 7.11, Firebird .07, IE 5.01 and I find no problems. I'm on a pc as you can see. So, I don't know about anything on a Mac. LINK REMOVED is the existing page but I'm using release candidate 31 right now. I'm updating the pages and when I finish I will upload with the final release 5.02, so I put the page up with that version on it here. LINK REMOVED They may take a minute to load if you're on dialup at 56k [as I] If it doesn't work perhaps you could specify which browser so someone can check it out.

Ruth

Edited- I tested the page you gave, downloaded it and put my menu code on it and it worked fine. So, they would really have to see the one on which you're having the problem


Poster: spaceman
Dated: Tuesday March 16 2004 - 12:59:21 GMT

Sorry for taking forever and a day to get back...

http://www.thewoolshack.com/index_no_slideshow.html

http://www.thewoolshack.com/index_with_slideshow.html

Take a look at the examples above. There is a single difference between each of these pages: one has the slideshow script removed (milonic menu works as intended), the other has the slideshow script included (milonic menu does not behave itself).

Any takers??? :-)

p.s. For what it's worth, what I'm actually trying to achieve with milonic 5.0 is an updated menu system looks and behaves exactly as per what you currently (at time of writing) see here, http://www.thewoolshack.com, but with milonic drop-down menus and not the pop-up ones we've got in place now. Even if we resolve this problem (apparent conflict between milonic and slideshow script), I _think_ there's one aspect of the 100% & centred menu challenge that I won't be able to crack: it's that I'd like all menu items on multiple rows to display in a strict grid system, as per http://www.thewoolshack.com. So the the items in each row would enlarge or contract hoziontally when the browser width is changed, but each item's width would be maintained as exactly the same width as the item immediately below it. I think that the only way to achieve this might be closer to menu sample #9 (http://www.milonic.com/menusample9.php) which positions menus in a td cell, but I'm not sure. Hmmm.


Poster: Ruth
Dated: Tuesday March 16 2004 - 17:54:06 GMT

LINKs REMOVED





And I have absolutely NO clue as to what was wrong with it. Not knowing code, I try with this, that, etc. I used the 100% span sample. First I tried to just copy that data to yours keeping your urls and such, but that didn't work, so then I copied and pasted the stuff from your menu data file to the menu data file for the sample, but with the changes you see in the actual file I uploaded... added -
screenposition="center";
itemheight="20px";

that seemed to work. I stopped playing with it when that worked, so the over/out filter is still there, though I did change the shadow color to the blue on your site. It may work without that, probably will but I didn't want to mess around when I finally got it to work.

Ruth

EDIT: I forgot. I'll leave this up for a bit, but please respond when you are done so I can take the files down. Thanks


Poster: Ruth
Dated: Tuesday March 16 2004 - 18:07:02 GMT

2nd question you had. I'm not sure I understand what you mean even though I went to the link. You can either declare a width for the submenus or not delcare one letting it do it automatically. If you don't declare one it will size according to the longest text item, plus padding etc. If you do declare one it will always be the size you declare. You might be able to design some kind of function to declare a width but then have it ignore that if the screen is say downsized, or upsized, I don't know, I'm not knowledgeable on codes and functions.

Ruth


Poster: kevin3442
Dated: Wednesday March 17 2004 - 0:27:10 GMT

Hi Spaceman,

Tried a local test of your index_with_slideshow example. You're currently using v5.02. When I tried the test with v5.02, it failed just like on your test page. Using v5.07, however, my local test worked just fine. So... try downloading the latest release and upload the three menu script files to your test site.

Hope that helps,

Kevin


Poster: John
Dated: Wednesday March 17 2004 - 14:09:00 GMT

Definitely pays to keep up with the most current version. Technically, anything older than the latest release is considered obsolete and not supported, as mentioned on http://www.milonic.com/menuvinfo.php.


Poster: spaceman
Dated: Wednesday March 17 2004 - 14:20:39 GMT

Great - thanks for all your help.

At the risk of asking a stupid question, I guess to get the latest version (5.07) I simply click the big fat download button after logging in to Milonic and this will always be the latest version? I just did this, and there was nothing jumping out at me to say "this is v.5.07" in any of the files that I looked at. Should there be?

Off-topic, but just to try to clear up my final 'challenge' that I didn't manage to explain well enough above: the current (non-Milonic) http://www.thewoolshack.com menu system (ignoring the pop-up sub menus) is built using this simple technique:

Code:
<table width='100%'>
<tr>
  <td width='33%'>item #1</td>
  <td width='33%'>item #2</td>
  <td width='33%'>item #3</td>
</tr>
<tr>
  <td width='33%'>item #4</td>
  <td width='33%'>item #5</td>
  <td width='33%'>item #6</td>
</tr>
</table>


This achieves the effect that all top-level menu items auto-scale to the same width, and are locked into (in this example above) a 2 row by 3 column grid system. This is what I'd really like to achieve with Milonic. So now we've cracked the 'conflict with another script' problem that started this thread, can anyone let me know if this effect above is possible with milonic? Can individual milonic menu items (from which drop-down sub-menu items appear) be incorporated into individual td's within the above structure, or can this same effect be achieved without the use of a table to create the 'grid'? Thanks again! Think up burning up my brownie points (if I ever had any) with this one... :-)


Poster: John
Dated: Wednesday March 17 2004 - 14:35:44 GMT

spaceman wrote:
At the risk of asking a stupid question, I guess to get the latest version (5.07) I simply click the big fat download button after logging in to Milonic and this will always be the latest version? I just did this, and there was nothing jumping out at me to say "this is v.5.07" in any of the files that I looked at. Should there be?

Correct for how to download..

As for the version, try the second line down in the comments at the top of each of the 3 code files...
Quote:
Version 5.07 - Built: Monday March 15 2004 - 17:54

Just above where you post your license number... :roll:
spaceman wrote:
Off-topic, but just to try to clear up my final 'challenge' that I didn't manage to explain well enough above

The first quick thought that comes to mind is to build individual menu JS files for each of the items and call then from the appropriate <td>. However, that's probably not the best way. I'm sure more suggestions will pop up.


Poster: Ruth
Dated: Wednesday March 17 2004 - 23:51:40 GMT

Code:
<td colspan='2'>[that's where your existing menu is]
   
<center><table border="0" cellpadding="0" cellspacing="0" width='100%'
align="center">
  <tr>
  <td colspan="4" width='100%' bgcolor="#F6F7F2"><script>
with(milonic=new menuname("Main Menu")){
style=menuStyle1;
menuwidth="100%";
menualign="center";
alwaysvisible=1;
orientation="horizontal";
itemheight="20px";
position="relative";
screenposition="center";
openstyle="rtl";
itemwidth="100%";
aI("text=home&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;showmenu=
Home;url=/index.htm;status=Back To Home Page;");
aI("text=about us&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;showmenu=
about us;");
aI("text=books&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;showmenu=
books;");
aI("text=knitting bags;//showmenu=knitting bags;");
}
drawMenus();

</script></td>
</td></tr>
</table></center></td>


This is the 'main menu'. Take it from the menu_data.js file and put it in that table. You'll see the non-breaking linespace codes in it after home, books, about us, that was to make it so that each menu item is [at least to the eye] the same width. There may be another way, but it's all I could make work. This will span the menu across the page. I set it to openstyle="rtl"; to get your dotoff.gif and doton.gif to the left of the word and the table is set to center position so it always remains center. As to the submenus, I'm still not sure what you want, but if you want them all to be the same width, you can set the width of the 'menuitem' in the actual submenus to a pixel value. I set the submenus to itemwidth="185px";. HERE'S your page with the menu designed like this. I'm not at all sure that's what you had in mind.

Ruth


Poster: spaceman
Dated: Sunday March 21 2004 - 14:39:36 GMT

Ruth, you're a legend. Are you some sort of 'forum angel' or something? :-)

What you achieved is closer than anything I've managed - would you mind leaving your example up for a bit longer so that I can get my head around it?

I have to confess though that I'm still (perfectionist that I am) trying to see if the 'perfect' solution isn't out there - one where the non-breaking spaces aren't necessary. Perhaps one where I build a separate menu for multiple tds on multiple rows - but right now I'm having problems even getting the unedited 'relative positioning (table bound)' example working (see: http://www.milonic.com/forum/viewtopic.php?t=3175).

Thanks again, you're most kind.


Poster: Ruth
Dated: Monday March 22 2004 - 4:16:17 GMT

You could do that, but that could cause problems, if you decide to do it, check outmac trouble faqs I sat to think about what the parameters would be for what you want.

1. a main menu with four items not in a table cell
2. you want to declare the menu's overall width as 100% so it will span the page no matter what the page size
3. you want each item to be equal in size to each other, therefore to be declared as 25% of the overall width [that would include padding, borders, etc] that would have to change as items were added to the main menu. If there were 5, then 20% and so on [I don't think % will work in itemwidth, I couldn't get it to do that]
4. you want each submenu that comes off the main menu to be declared as taking whatever size the main menu item happens to be on that particular page [which would be based on 640x480, 800x600, etc] [640 I don't think would work because of the 100% span and your page won't downsize to that without the scroll bars]
5. and I think from what I read, you want any submenus to submenus to open the same size also?

What comes to mind is that there may be a way to get a function that will read the browser and then make the menu the correct width, not sure about submenus but I think that might have to also be a function, but that is way beyond anything I know how to do.

Ruth