PDA

View Full Version : BLM menu help



Mminnig
01-23-2007, 09:24 PM
1) Script Title: BLM Multilevel Menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/blmmenu/index.htm

3) Describe problem:
I opted to switch to the BLM menu because the HV menu was loading last and slowing down my pages tremendously. I also wanted to load the menu from a database more easily.

Now, with the BLM menu, any areas where I used the CMotion Gallery have stopped working.

Here is how they should function:
http://www.kydex.com/test/widget_articles.asp

When displayed within an iFrame on a page with the BLM menu, they don't scroll: http://www.kydex.com/test/company_presidentsmessage.asp

I thought the iFrame would have solved my problems but it appears I wasn't that lucky.... any help is greatly appreciated!

jscheuer1
01-24-2007, 07:31 AM
This comment is invalid:


/***********************Script below added to prevent menus from displaying on page load if javascript is enabled************************//

Remove it or remove the extra / at the end of it. There could be other problems and probably are. The gallery works fine in FF so, I suspect that it is an IE specific issue with regard to the iframe or a conflict in IE with regard to the other script on the iframe's src page.

jscheuer1
01-24-2007, 08:43 AM
Yes, as I looked into it more, it appears to be a script conflict. On your widget page put this after the motiongallery.js script link:


<script type="text/javascript" src="motiongallery.js">

/***********************************************
* CMotion Image Gallery- Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/

</script>
<script type="text/javascript">
if ( typeof window.addEventListener != "undefined" )
window.addEventListener( "load", fillup, false );
else if ( typeof window.attachEvent != "undefined" )
window.attachEvent( "onload", fillup );
else {
if ( window.onload != null ) {
var oldOnload = window.onload;
window.onload = function ( e ) {
oldOnload( e );
fillup();
};
}
else
window.onload = fillup;
}
</script>
</head>

Notes: There were still errors after that but, at least it worked in an iframe locally in IE.

Mminnig
01-24-2007, 03:44 PM
Thank you for your help as I realize that script-conflict requests are usually frowned upon.

I added the script that you suggested for both of the widgets that use the CMotion Gallery and unfortunately it still isn't working in IE:

Individual Pages:
http://www.kydex.com/test/widget_articles.asp
http://www.kydex.com/test/widget_partgallery.asp

Pages when included inside iFrames on main Page:
http://www.kydex.com/test/company_presidentsmessage.asp

Main site with no menu (I just removed the <ul> from the page):
http://www.kydex.com/test/company_presidentsmessage_test.asp

jscheuer1
01-24-2007, 05:33 PM
Apparently there was more than one problem. Diagnosing in iframes across domains (as would be required for local testing on my end) isn't feasible as security restrictions will interfere.

However, removal of the menu having fixed this suggests that it has defined something for the iframe that conflicts with its script(s).

I would start by (as a test) removing this:


<!--[if IE]>
<link rel="stylesheet" href="hack.css">
<script type="text/javascript">
window.mlrunShim = true;
</script>
<![endif]-->

from the full version of the page, if that fixes the problem (it may create a problem between the menu and the fading slideshow) we can try modifying the code it calls and uses to be more compatible with other iframes on the page or find another way around conflicts with the fade show. If removing it fixes the galleries and causes no other problems we are done.

Mminnig
01-24-2007, 09:39 PM
Well that worked beautifully to fix the problem with the CMotion galleries! Thank you!

Only catch is that it shifted the drop-down menus to the right...
http://www.kydex.com/test/company_presidentsmessage.asp

I tried using a -129 left margin in the css.css file for the .horizontal li ul item, and it looks like that route might work, but it screws up the positioning in Firefox....

Any thoughts?

jscheuer1
01-25-2007, 04:52 AM
That's actually very good news. You should then be able to replace this onto the page without the script call, like so:


<!--[if IE]>
<link rel="stylesheet" href="hack.css">
<![endif]-->


And, edit hack.css to look like so (removing the iframe stuff):


/*Not really sure why IE needs all these,but hey it works!*/
.horizontal li ul{
margin-top: none;
margin-left: -129px;
}
.horizontal li li ul{
position: absolute;
left: 0px;
}

This will deactivate iframe shim for IE but, this is only required to overcome a bug prior to IE 7 that allows selects to appear over all other content. You have no selects that could interfere with the menu anyway, so it won't make any difference to remove those parts.

I am still a little concerned that after a few cycles of the fading images below the menu that they will begin to obscure the menu in IE. But, in testing just now, this doesn't appear to be the case.

Mminnig
01-25-2007, 03:38 PM
It worked perfectly! Thank you for all of your help!
http://www.kydex.com/test/company_presidentsmessage.asp

Once last question regarding the menu. The sub-sub menu displays by default. (visit the link and rollover the "Products" menu item. You will see that the sub-sub menu for "Product List" displays automatically).

Is there a way to hide this? Would it be similar to your earlier solution with the script below?
<script type="text/javascript">
if(document.getElementById)
document.write('<style type="text/css"> .horizontal li ul {display: none;} <\/style>');
</script>

With further testing, I can only get this error to happen about 50&#37; of the time and not with any consistent causes. Hmmm... My only fear is that I am going to start adding a lot of sub-sub menus and I would hate for them to all start behaving this way.

jscheuer1
01-25-2007, 04:01 PM
Maybe. I'm not clear on the problem. If you mean that the subs display until the onload event fires, then yes. If you are talking about something else, it may be a bug in the script. Which is it? What exactly happens? I can't seem to get it to do it all.

Mminnig
01-25-2007, 04:19 PM
Sometimes (I can't put my finger on it) when you roll over the "Products" Menu item the sub menu appears (as it should) AND the sub-sub menu for "Product List" also displays even though your mouse is only on the main menu item.

Here is a link to a screen shot of what I am referring to:
http://www.kydex.com/test/img/rollover_problem.jpg

In the screenshot, the mouse is only over the main menu item "Products".

Worth noting is that only the <ul> appears for the sub-sub menu and none of the <li>'s are displayed.

Mminnig
01-25-2007, 04:27 PM
Ok.... here is what appears to trigger the problem:

Rollover "Products"
Rollover "Product List"
Rollover the list of products and Rollout from that sub-sub menu.

The next time you Rollover the "Products" menu, the <ul> for the sub-sub menu will display.

This only happens if the Rollout occurred from the sub-sub menu.
If you Rolled Out from any other menu item, the error will not occur.


I'm praying that made sense? Is it a script error with the portion that allows for the delay in hiding the menu?

jscheuer1
01-25-2007, 04:56 PM
I see it. It doesn't appear to be a part of the onload problem from before and I cannot get the DD demo page to do it. It may be because your page has no DOCTYPE or because of the other modifications we made to the menu script. I'd test the second idea first. Go back to the default code for the menu, with the original hack.css file (be sure to restore it to it original condition) and reinstate the script call:


<!--[if IE]>
<link rel="stylesheet" href="hack.css">
<script type="text/javascript">
window.mlrunShim = true;
</script>
<![endif]-->

and without this:


<script type="text/javascript">
/***********************Script below added to prevent menus from displaying on page load if javascript is enabled************************/
if(document.getElementById)
document.write('<style type="text/css"> .horizontal li ul {display: none;} <\/style>');
</script>

If that fixes it, we need to figure out why because, I don't think it should. If not, try using this DOCTYPE for your page:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>


It may still be a bug in the script as, there is nothing on the DD demo page that is exactly like what you have as far as nesting to one and only only one level with no 'special effects' and no sub available image/indicator.

Mminnig
01-25-2007, 05:35 PM
Unfortunately neither of those appeared to fix the problem. (and adding the doc type actually altered the widths and threw them all out of alignment)

With further testing it appears that the problem is in the "delay" option. With it removed, the menus behave as expected:
http://www.kydex.com/test/company_presidentsmessage.asp

jscheuer1
01-25-2007, 05:48 PM
Well, that is a bug in the menu then, or at least qualifies for a bug report if we can't fix it with an existing update. BLM is actually a coder who participates in these forums fairly regularly. As I recall he sometimes has updates available for download from his web site that are not on the DD demo page. Make sure you are using the most recent update:

http://www.webtech101.com/index.php?page=effect-menu

Mminnig
01-25-2007, 05:54 PM
Thank you again for all of your help! I greatly appreciate it.

blm126
02-05-2007, 04:39 PM
Well, that is a bug in the menu then, or at least qualifies for a bug report if we can't fix it with an existing update. BLM is actually a coder who participates in these forums fairly regularly. As I recall he sometimes has updates available for download from his web site that are not on the DD demo page. Make sure you are using the most recent update
The version on DD hasn't been updated in a while. I can't remember exactly ,but I'm pretty sure this was fixed in the version on my site.