submenus hidden by Java Applet (form hiding ?)

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
lunagraphica
Advanced
Advanced
Posts: 10
Joined: Wed Sep 12, 2007 7:13 pm

submenus hidden by Java Applet (form hiding ?)

Post by lunagraphica »

From the research I've done, it seems there is not real solution to this, because Applets don't work with z-index.

I'd like to simply hide the applet when the submenu pops up. I've seen references in the forum to a "form hiding" technique, but the links are broken. Can someone please explain how to do this?
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: submenus hidden by Java Applet (form hiding ?)

Post by Ruth »

Hi,

I have no idea about that mm_divHide function. That is very old. There is now available a divhider.js file, it is at the bottom called the Object hiding module. I'm not really sure this will work for applets, but...

http://milonic.com/menumodules.php

To use it you would do the following. This is just an example I had and uses a form setup

Code: Select all

<SCRIPT language=JavaScript src="divhider.js" type=text/javascript></SCRIPT>
<div id=formdiv1 name=formdiv1> 
<form>
<select>
<option>Testing to see - form in div with divhider.js file called
<option>if the menu will
<option>sit on top of
<option>select boxes
</select>
</form>
Then in the divhider.js module you need to code the main/sub menu item names that have submenus that drop over the applet. I used the downloaded menu as the set up and in the divhider.js file and at the M_hideMenus= line had this [all one line, no wrap or it will break the code]

Code: Select all

M_hideMenus = "Samples->formdiv1;Milonic->formdiv1;Partners->formdiv1;Links->formdiv1;MyMilonic->formdiv1;Anti Spam->formdiv1;"
As I said I do not know if this will work with applets or not. Nothing works on things like media players and I don't know if applets are the same. Flash objects can be hidden using their own setups setting wmode to transparent.

One thing I was thinking might work, but haven't tested, is to set up the applet area as an iframe, then put the applet on the page in the iframe. The menu drops over iframes, I'm not sure given the page is in an iframe if it would go over the applet or not. I'll test to see what happens once I get an applet :)

Ruth
lunagraphica
Advanced
Advanced
Posts: 10
Joined: Wed Sep 12, 2007 7:13 pm

Re: submenus hidden by Java Applet (form hiding ?)

Post by lunagraphica »

no joy...

apparently Applets are not well behaved with regard to display, even when contained in a div. I can hide the div, but the Applet is still visible.
lunagraphica
Advanced
Advanced
Posts: 10
Joined: Wed Sep 12, 2007 7:13 pm

I spoke too soon - it worked!

Post by lunagraphica »

It appears I had a bug in my code, but once I got it sorted out, I can indeed hide an Applet contained in a div.

Here's the proof:

http://www.apropos-logic.com/nc/test.html

Thank you, Ruth!
luisraposo
Advanced
Advanced
Posts: 20
Joined: Wed Aug 29, 2007 2:49 pm

Re: submenus hidden by Java Applet (form hiding ?)

Post by luisraposo »

hello,

I am trying to do the same with an ActiveX object, which is taking a whole 'contents' frame.
As I can't get it to work with the (sub-)menus, since it flickers too much (fixMozzila & zIndex didn't do the trick), I am now moving to the "hide" solution..

- I am calling the "divhider.js" script on the .htm (actually on both, the 'navigation' and the 'contents' frame)
- the M_hideMenus variable is changed on the script

but it doesn't do nothing.. :(

actually, I am wondering, when is the "M_hideLayer" function called?
(I added some debug code on it, but nothing comes out.. :roll:)

your help is appreciated, :D
luis
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: submenus hidden by Java Applet (form hiding ?)

Post by Ruth »

Hi Luis,

I'm sorry, but if you're mousing over the main menu and trying to hide the div on a different frame, I don't believe that going to happen. If this is at all possible through some kind of programming I think you'll have to contact Milonic for that.

_______________
lunagraphica,

One other thing about using the divhider module. You might do a screen capture of that beginning applet [or anything else you want, and then place that in the same size div right behind the applet div, then when you hid the applet you'll see a div with a screen capture of the applet. Hope that made sense.

Ruth
luisraposo
Advanced
Advanced
Posts: 20
Joined: Wed Aug 29, 2007 2:49 pm

Re: submenus hidden by Java Applet (form hiding ?)

Post by luisraposo »

Ruth/lunagraphica,
thanks for keeping up with this, :)

I dared myself to a bit of coding on the divhider.js

Code: Select all

M_hideMenus = "cracker->PI_DISPLAY;"

function M_hideLayer(_mnu,_show){

   //if(op7||ie55||ns6||ns7)return
   M_hdar=M_hideMenus.split(";");

   for(_Ma=0;_Ma<M_hdar.length;_Ma++){
      M_hdarI=M_hdar[_Ma].split("->")
      M_mnu=getMenuByName(M_hdarI[0]);

      if(M_mnu>-1&&M_mnu==_mnu){
         /*
         M_gm=gmobj(M_hdarI[1])
         if(_show){
            M_gm.style.visibility="hidden"
         }
         else{
            M_gm.style.visibility="visible"
         }		
         */			

         var _div = top.window.frames["content"].document.getElementById(M_hdarI[1]);
         if (_show){
            _div.style.visibility = 'visible';
         }
         else{
            _div.style.visibility = 'hidden';
         }
					
      }
   }	
}
. the code was not running because (ie55) is 'true' on my IE6, and the function stopped, returning nothing
. to have the sub-menus names recognized in M_mnu I had to add the menu-data-sub_menus.js (my sub-menus on the 'contents' frame) to the 'navigation' .html frame
. the code now recognizes a DIV in a separate frame (while it can be improved to cycle through every frame and look for the object M_hdarI[1]..)

It is working to hide de div :D
but.. somehow it does not make the DIV visible again, _show is never "1" besides the initial startup

any help would be much appreciated,
luis

ps: thanks for your tip on the "screen capture", it is a nice idea to have something there instead of "blank"
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: submenus hidden by Java Applet (form hiding ?)

Post by Ruth »

Hi Luis,

Wow, that is great. I will post this to Milonic. Unfortunately I can't do the js stuff so I have no idea why it's not reshowing the div, unless it's because you are on a different frame when you mouseOff. Maybe you need some kind of extra code to tell it that??? I know in the frames menu, there's an off and onfunction for the mouse. Of course, what do I know :lol:

Ruth
luisraposo
Advanced
Advanced
Posts: 20
Joined: Wed Aug 29, 2007 2:49 pm

Re: submenus hidden by Java Applet (form hiding ?)

Post by luisraposo »

hello,

I'm one step closer to happiness :D
the divhider.js module now works across frames, independent of frame name
and the DIV is made visible or not depending on the menu selection

Code: Select all

M_hideMenus = "cracker->PI_DISPLAY;poliolefinas->PI_DISPLAY;"

function M_hideLayer(_mnu,_show){

	//if(op7||ie55||ns6||ns7)return
	M_hdar=M_hideMenus.split(";");

	for(_Ma=0;_Ma<M_hdar.length;_Ma++){

		M_hdarI=M_hdar[_Ma].split("->")
		M_mnu=getMenuByName(M_hdarI[0]);

		if(M_mnu>-1&&M_mnu==_mnu){
			// M_gm=gmobj(M_hdarI[1])
			var _frames = top.window.frames;
			for( var i=0; i < _frames.length; i++ ) 
			{
				M_gm = _frames[i].document.getElementById(M_hdarI[1]);
				if (M_gm){
					if(_show){
						M_gm.style.visibility='hidden';
					}
					else{
						M_gm.style.visibility='visible';
					}		
				}
			}			
		}
	}	
}
but, the DIV is hidden only for the time the main menu option is enabled, after a few seconds only the submenu is enabled, and I get back the DIV visible, with the flickering when going through the submenu options..

How can I keep the main menu option "on" for all the time the submenu is visible?

luis
luisraposo
Advanced
Advanced
Posts: 20
Joined: Wed Aug 29, 2007 2:49 pm

Re: submenus hidden by Java Applet (form hiding ?)

Post by luisraposo »

hello,

here go my findings:

- the main menu option only remains 'selected' if the submenus are on the same menu-data file
(thus making the divhider.js module working as expected)

- to have the main (horizontal) menu and sub-menus (drop-down) working on the same file (see above) I had to change from frames into Iframes (since the submenus would not be visible inside a page header frame)

- on the menu item definitions, we can user either target=iframe_name, or call openIframe

Code: Select all

aI("text=xxx;url=`javascript:openIFrame('content','/xxx.htm')`;");
- now that I have Iframes setup, and breadCrumbs is working as expected, highlighting items from main menu to submenu option, the page definitions are not working : neither pageimage nor pagebgimage :(

Code: Select all

pageimage="/images/pagematch_marker.gif";
pagecolor="#000000";
//pagebgcolor="#";
pagebgimage="/images/pagematch_submenus_blue-white-blue.jpg";
> according to http://milonic.com/menufaq.php#linkHighlight, calling pagehighlight would do the trick..
but

Code: Select all

aI("text=Armazenagem;url=`javascript:highlightme();openIFrame('content','/OLEFINAS/CRACKER/Armazenagem.htm')`;clickfunction=mm_breadCrumbs();separatorsize=1;");
throws error: '_I.19' is null or not an object

here goes the highlightme function

Code: Select all

function highlightme()
{
_I=_mi[_itemRef];
if(_I[19])_I[7]=_I[19];
if(_I[18])_I[8]=_I[18];
itemOff(_itemRef);
}
Can you help me with this final step to have this amazing menu fully working?

thanks,
luis
luisraposo
Advanced
Advanced
Posts: 20
Joined: Wed Aug 29, 2007 2:49 pm

Re: submenus hidden by Java Applet (form hiding ?)

Post by luisraposo »

hum.. I see now.. what highlightme() does..
the indexes are no more than the CodeRefs from http://milonic.com/itemproperties.php
I should have looked better.. :oops:

now, the only thing missing is to figure out how to "un-"highlight the menuitems..

a couple of sleeping hours will do magic :)

luis
luisraposo
Advanced
Advanced
Posts: 20
Joined: Wed Aug 29, 2007 2:49 pm

Re: submenus hidden by Java Applet (form hiding ?)

Post by luisraposo »

hello again,

I have done some changes to the breadCrumbs function, which is now using the page settings when 'highlighting' menuitems (the images are also taken care)

Code: Select all

//var mm_breadCrumbAnchor = -1;
var currentItem = 0;	// "Geral"

function myPageMatch()
{
  var selectedItem = _itemRef;
  var i = currentItem;

  if (mm_closeBcMenus) $Z();
  
 if (i > -1)
    do {
      /*
      _mi[i][7] = _m[_mi[i][0]][6].offbgcolor;
      _mi[i][8] = _m[_mi[i][0]][6].offcolor;
      */
      // _m == menu , _mi == menu_item 
 	  // _m[][6] == style
  	  // _mi[8] == offcolor , _mi[7] == offbgcolor , _mi[29] == image , _mi[46] == bgimage
 	  
  	  _mi[i][8] = _m[_mi[i][0]][6].offcolor ? _m[_mi[i][0]][6].offcolor : null;
  	  _mi[i][7] = _m[_mi[i][0]][6].offbgcolor ? _m[_mi[i][0]][6].offbgcolor : null;
   	  _mi[i][29] = _m[_mi[i][0]][6].image ? _m[_mi[i][0]][6].image : null;
  	  _mi[i][46] = _m[_mi[i][0]][6].bgimage ? _m[_mi[i][0]][6].bgimage : null;
      BDMenu(_mi[i][0]);
      i = getParentItemByItem(i);
    } while (!isNaN(i) && mm_highlightParentItems);
}

  i = currentItem = selectedItem;
  do {
  	/*
    _mi[i][7] = _mi[i][19];
	_mi[i][8] = _mi[i][18];
	*/
    // _m == menu , _mi == menu_item 
 	// _m[][6] == style
  	// _mi[8] == offcolor , _mi[7] == offbgcolor , _mi[29] == image , _mi[46] == bgimage
  	
  	if (_m[_mi[i][0]][6].pagecolor) _mi[i][8] = _m[_mi[i][0]][6].pagecolor;
  	if (_m[_mi[i][0]][6].pagebgcolor) _mi[i][7] = _m[_mi[i][0]][6].pagebgcolor;
  	if (_m[_mi[i][0]][6].pageimage) _mi[i][29] = _m[_mi[i][0]][6].pageimage;
  	if (_m[_mi[i][0]][6].pagebgimage) _mi[i][46] = _m[_mi[i][0]][6].pagebgimage;
    BDMenu(_mi[i][0]);
    
    i = getParentItemByItem(i);
  } while (!isNaN(i) && mm_highlightParentItems);

}
currentItem is zero because in the beggining I have the first main menu option appearing "selected"
(by the way, beside setting manually the menu item properties, to become "selected", I had to add itemOn / itemOff, so the colors/images were loaded.. - buildAllMenus = true; didn't solve it also)

Code: Select all

itemOn(0);
setTimeout('itemOff(0)', 1000);
the Timeout creates a nice effect when loading the page, like if the user just selected that menu item ;)


I am now using both the 'divhider' and the 'breadCrumbs'.. and it works fine :)
but, when I select an option on the menu, the DIV is made visible with the 'old' activeX object, and then the contents page is loaded with a 'new' activeX object..
I have been trying to prevent the DIV from being made visible again before the new object is loaded, but without sucess..

Do you have any ideas on how can I accomplish this?

luis
sandra nair
Beginner
Beginner
Posts: 1
Joined: Tue Oct 09, 2007 12:10 pm

Re: submenus hidden by Java Applet (form hiding ?)

Post by sandra nair »

Hi luis,

I have got a similar problem .My menu items are flickering on mouse over if some activecomponents (a word doc or a crystal report)are there in the body page :( I believed that is related to the browser but it seems you got some solution for the same.It will be really great if could help me in solving the same.

I am using a frameset based menu. Which is working fine except over the acive x components.


Thank You
Sandra Nair
Post Reply