Missing Home Page Icon

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
darkcircuituk
Super Advanced
Super Advanced
Posts: 49
Joined: Sat Aug 21, 2004 2:57 pm

Missing Home Page Icon

Post by darkcircuituk »

I have added a link to my website homepage on my context right click menu, and when you are not on the homepage, the icon in the context menu is present, but the moment you goto the homepage and then bring up the context menu again, the icon is missing. Can someone tell me why please? :cry: and how to fix it :cry:
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

A URL is always requested. Helps a lot!
John
darkcircuituk
Super Advanced
Super Advanced
Posts: 49
Joined: Sat Aug 21, 2004 2:57 pm

Confusion

Post by darkcircuituk »

I don't mean to be ungrateful but either I don't understand your reply or I explained my problem wrong.

I am using sample 27 (the right click context menu), and when I right click on a page other than the homepage stated in the right click menu, then the context menu comes up with the homepage icon present next to the link. But when I goto the homepage then bring up the right click menu, the homepage icon is missing like it is unable to find the file (although the link to the homepage does still work). Is it possible to stop the icon disapeering when I goto the homepage stated in the right click menu?
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

We need a URL for your site where you are having the problem.

Not to worry - it didn't sound ungrateful.
John
darkcircuituk
Super Advanced
Super Advanced
Posts: 49
Joined: Sat Aug 21, 2004 2:57 pm

Slight Problem with Your Request

Post by darkcircuituk »

One slight problem, the website is internal and therefore cannot be accessed by the outside world, and due to the company's data security policy, I am unable to display a whole page worth of code. But when I return to work tomorrow, I can send u a couple of snippets of the code for specific sections, that you believe would help you to determine the problem. Please let me know which sections of code I should place here.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Post at least the menu _data file and the JS menu calls. If you're doing anything "strange" in the HTML please post that as well (what you can).

Don't forget to use the [code][/code] tags when posting the code.
John
darkcircuituk
Super Advanced
Super Advanced
Posts: 49
Joined: Sat Aug 21, 2004 2:57 pm

Here's the code

Post by darkcircuituk »

Below I post the code for the menu_data.js file:

Code: Select all

/*
   Milonic DHTML Menu Context/Right Click Menu Module contextmenu.js version 1.1
   This module is only compatible with the Milonic DHTML Menu version 5.16 or higher

   Copyright 2004 (c) Milonic Solutions Limited. All Rights Reserved.
   This is a commercial software product, please visit http://milonic.com/ for more information.
*/

_menuCloseDelay=500           // The time delay for menus to remain visible on mouse out
_menuOpenDelay=150            // The time delay before menus open on mouse over
_subOffsetTop=0               // Sub menu top offset
_subOffsetLeft=0              // Sub menu left offset

contextDisabled=false;
contextMenu="contextMenu";

function it_group_web(){
  parent.location=("http://scmpr3/management/Environment_Management/Tools/ITGroupWeb/test/index.htm");
}

function org_process_web(){
  parent.location=("http://scmpr3/management/Environment_Management/Tools/OrgProcessWeb/test/index.htm");
}

function measure_meta_data(){
  parent.location=("http://scmpr3/management/Environment_Management/Tools/MeasurementMetadataWeb/test/index.htm");
}

function its_programme(){
  parent.location=("http://scmpr3/management/Environment_Management/Tools/ProgrammeWeb/ITS_Programme/index.htm");
}

function its_cycle_1(){
  parent.location=("http://scmpr3/management/Environment_Management/Tools/ProjWeb/IT_Strategy_RUP/index.htm");
}

function its_cycle_2(){
  parent.location=("http://scmpr3/management/Environment_Management/Tools/ProjWeb/IT_Strategy_Cycle2/index.htm");
}

function rclick(e){
	if(contextDisabled)
	{
		_d.oncontextmenu=null
		return true;
	}
	if(_d.all)ev=event.button; else ev=e.which
	if(ev==2||ev==3){
		_gm=getMenuByName(contextMenu)
		if(_gm!=null)popup(contextMenu,1)
		return false
	}
	else{
		//if(ev==1)closeAllMenus();
	}
	return true;
}

if(ns4){
	_d.captureEvents(Event.MOUSEDOWN);
	_d.onmousedown=rclick;
}
else{
	_d.onmouseup=rclick
	_d.oncontextmenu=new Function("return false")
}

function Vsrc(){window.location="view-source:"+window.location.href}

with(contextStyle=new mm_style)
{
     onbgcolor="#ECF4F9";
       oncolor="#000000";
    offbgcolor="#ffffff";
      offcolor="#000000";
   bordercolor="#999999";
   borderstyle="solid";
   borderwidth=1
    overfilter="Fade(duration=0.2);Shadow(color='#777777', Direction=135, Strength=3)"
     pagecolor="";
   pagebgcolor="#eeeeee";
    pageborder="1px solid #ffffff";
    pageimage="http://scmpr3/management/Environment_Management/Tools/ProjWeb/IT_Strategy_RUP/js/right_click_menu/images/db_red.gif";
      onborder="1px solid #316AC5";
separatorcolor="#999999";
     outfilter="randomdissolve(duration=0.4)"
      fontsize="75%";
     fontstyle="normal";
    fontfamily="arial, verdana, tahoma";
 separatorsize=0;
       padding=3
 headerbgcolor="#4F8EB6";
   headercolor="#ffffff";
  headerborder="1px solid #000000";
      fontsize="10px";
      subimage="http://scmpr3/management/Environment_Management/Tools/ProjWeb/IT_Strategy_RUP/js/right_click_menu/images/black_13x13_greyboxed.gif";
if(!mac)onborder="1px solid #000000";
}

with(milonic=new menuname("contextMenu")){		
top="offset=2"
style = contextStyle;
margin=3
aI("text=Home Page;url=http://scmpr3/management/Environment_Management/Tools/ProjWeb/IT_Strategy_RUP/main/home_page.htm;image=http://scmpr3/management/Environment_Management/Tools/ProjWeb/IT_Strategy_RUP/js/right_click_menu/images/home.gif");
aI("text=Intranet;url=http://intranet/;image=http://scmpr3/management/Environment_Management/Tools/ProjWeb/IT_Strategy_RUP/main/home_page.htm;image=http://scmpr3/management/Environment_Management/Tools/ProjWeb/IT_Strategy_RUP/js/right_click_menu/images/sample.gif");
aI("text=ITS Webs;showmenu=ITS Webs;");
aI("text=Organisational Webs;showmenu=Organisational Webs;separatorsize=1;");
aI("text=Back;url=javascript:history.go(-1);image=http://scmpr3/management/Environment_Management/Tools/ProjWeb/IT_Strategy_RUP/js/right_click_menu/images/back.gif");
aI("text=Forward;url=javascript:history.go(1);image=http://scmpr3/management/Environment_Management/Tools/ProjWeb/IT_Strategy_RUP/js/right_click_menu/images/forward.gif");
aI("text=Refresh;url=javascript:history.go(0);image=http://scmpr3/management/Environment_Management/Tools/ProjWeb/IT_Strategy_RUP/js/right_click_menu/images/refresh.gif");
aI("text=Print;url=javascript:window.print();image=http://scmpr3/management/Environment_Management/Tools/ProjWeb/IT_Strategy_RUP/js/right_click_menu/images/print.gif");
aI("text=Properties;url=javascript:document.properties();image=http://scmpr3/management/Environment_Management/Tools/ProjWeb/IT_Strategy_RUP/js/right_click_menu/images/browser.gif");
aI("text=View Page Source;url=javascript:Vsrc();separatorsize=1;");
};

with(milonic=new menuname("ITS Webs")){
style = contextStyle;
margin=3;
overflow="scroll";
itemwidth=150;
aI("text=ITS Programme;url=javascript:its_programme();image=http://scmpr3/management/Environment_Management/Tools/ProjWeb/IT_Strategy_RUP/js/right_click_menu/images/org.gif");
aI("text=ITS Cycle 1;url=javascript:its_cycle_1();image=http://scmpr3/management/Environment_Management/Tools/ProjWeb/IT_Strategy_RUP/js/right_click_menu/images/org.gif");
aI("text=ITS Cycle 2;url=javascript:its_cycle_2();image=http://scmpr3/management/Environment_Management/Tools/ProjWeb/IT_Strategy_RUP/js/right_click_menu/images/org.gif");
};

with(milonic=new menuname("Organisational Webs")){
style = contextStyle;
margin=3;
overflow="scroll";
itemwidth=150;
aI("text=IT Group Web;url=javascript:it_group_web();image=http://scmpr3/management/Environment_Management/Tools/ProjWeb/IT_Strategy_RUP/js/right_click_menu/images/org.gif");
aI("text=Measurement Meta-Data;url=javascript:measure_meta_data();image=http://scmpr3/management/Environment_Management/Tools/ProjWeb/IT_Strategy_RUP/js/right_click_menu/images/org.gif");
aI("text=Org Process Web;url=javascript:org_process_web();image=http://scmpr3/management/Environment_Management/Tools/ProjWeb/IT_Strategy_RUP/js/right_click_menu/images/org.gif");
};

drawMenus()
The call to the menu can be seen below:

Code: Select all

<head>
<title>Useful Links</title>
<link rel="stylesheet" type="text/css" href="http://websites.milonic.com/intranet/include/intranet.css">
<script type="text/javascript" src="../js/right_click_menu/menu_data.js"></script>
<script type="text/javascript" src="../js/right_click_menu/milonic_src.js"></script>	
<script	type="text/javascript">
<!-- 
  _d.write("<script language=JavaScript src=../js/right_click_menu/mmenudom.js></script>"); 
-->
</script>
<script type="text/javascript" src="../js/right_click_menu/menu_data.js"></script>
</head>
darkcircuituk
Super Advanced
Super Advanced
Posts: 49
Joined: Sat Aug 21, 2004 2:57 pm

In Hope

Post by darkcircuituk »

Hope you can help :-(
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi,

I see two potential problems in the code you posted.

(1) When you load your menu source files with the following code:

Code: Select all

<script type="text/javascript" src="menu_data.js"></script>
<script type="text/javascript" src="milonic_src.js"></script>
<script   type="text/javascript">
<!--
  _d.write("<script language=JavaScript src=mmenudom.js></script>");
-->
</script>
<script type="text/javascript" src="menu_data.js"></script>
you are loading menu_data.js twice! menu_data.js should only be loaded once, and it should be done after menu_src.js, etc. are loaded. Also (and this isn't a poblem so much as a style thing), it looks like you've eliminated mmenuns4.js... I'm guessing because it's an intranet and you don't need to support ns4. Good call. However, if you don't need the conditional test, then you don't need to load mmenudom.js using document.write(). You could replace

Code: Select all

<script   type="text/javascript">
<!--
  _d.write("<script language=JavaScript src=mmenudom.js></script>");
-->
</script>
with

Code: Select all

<script type="text/javascript" src="mmenudom.js"></script>
The entire block of code would then be:

Code: Select all

<script type="text/javascript" src="milonic_src.js"></script>
<script type="text/javascript" src="mmenudom.js"></script>
<script type="text/javascript" src="menu_data.js"></script>
(2) I would guess that the loss if the image you mentioned is probablydue to a path problem; the browser can't find the image using the path you specified. The paths you use seem odd to me:

Code: Select all

image=http://scmpr3/management/...etc.
To me, an http:// should be followed by a domain name or IP address for the web server, then by directory paths and file names. Yours appears to be followed immediately by a directory name. Maybe your webserver is set up in a fashion that I'm not used to? If scmpr3 branches off of the site's root, then you should be find by just specifying

Code: Select all

image=/scmpr3/management/...etc.
That's my best guess without being able to see the actual pages. Hope it helps.

Kevin
darkcircuituk
Super Advanced
Super Advanced
Posts: 49
Joined: Sat Aug 21, 2004 2:57 pm

Fixed it

Post by darkcircuituk »

I fixed the prob, thanks anyway :-)

It was to do with how the menu has been designed.
Post Reply