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: Thursday February 8 2018 - 06:02:10

clickfunction does not seem to be firing.


Poster: cubefree
Dated: Friday April 2 2004 - 3:12:04 BST

My clickfunction does not seem to be firing. I've added an alert, but nada. I'm doing this only to show state on my sub-navigation that uses anchor names. Pagematch does not seem to work if you click on a link using an anchor name tag. After the page loads, try 'online invoicing' or 'data conversions'. The page should reload. But it doesn't. Any ideas??

Some info:

http://www.cubefree.com/dev/services/printcmu.php#shelftalker

Code: Select all

function resize() {
  alert('reloaded');
  document.location.href = history.go(0);
}

var wm = 'services/webmarketing';
var ts = 'services/techservices';
var pc = 'services/printcmu';
var pm = 'services/projectmanagement';

// bullet graphic (pi ~ pageimage)
var pi = ''; //'<img src='+DOM+'images/graphics/v_bullet.gif hspace=3 border=0>';

with(leftStyle=new mm_style()){
padding=0;
menuwidth=150;
align="right";
oncolor="#D3714E";
offcolor="#999999";
pagecolor="#C94522";
fontsize="10px";
fontstyle="normal";
fontfamily="Verdana, sans-serif;";
onbold=0;

if (ie) {
   overfilter="Fade(duration=2.0);Alpha(opacity=100)";
   outfilter="randomdissolve(duration=0.3)";
   }
}

var menu_top  = "text=<img src="+DOM+"images/spacer.gif width=150 height=18 border=0>;"
var sub_top   = "text=<img src="+DOM+"images/spacer.gif width=150 height=10 border=0>;"
var dasher    = "text=<img src="+domlav+"dashedline.gif width=150 height=1 vspace=5 border=0>;"
var sepp      = 'separatorsize=1;separatorpadding=5;';



with(milonic=new menuname("services")){
style=leftStyle;
top=158;
left=leftnav_left;
menuwidth=150;
alwaysvisible=1;
orientation="vertical";
followscroll = "55,50,15";

aI("image="+domlav+"services.gif;url="+DOM+"services/index.php;separatorsize=0;");
aI(menu_top);

aI("image="+domlav+"webmarketing.gif;overimage="+domlav+"webmarketing_f2.gif;url="+DOM+"services/webmarketing.php;pageimage="+domlav+"webmarketing_f3.gif;pagematch="+DOM+"services/webmarketing;");

if (url.indexOf(wm) != -1) {
   aI(sub_top);
   aI("text="+pi+"design \& development;"+sepp);
   aI("text="+pi+"online marketing;"+sepp);
   aI("text="+pi+"online advertising;"+sepp);
   aI("text="+pi+"search engine rankings;"+sepp);
}
aI(dasher);

aI("image="+domlav+"techservices.gif;overimage="+domlav+"techservices_f2.gif;url="+DOM+"services/techservices.php;pageimage="+domlav+"techservices_f3.gif;pagematch="+DOM+"services/techservices;");

if (url.indexOf(ts) != -1) {
   aI(sub_top);
   aI("text="+pi+"database / web applications;"+sepp);
   aI("text="+pi+"e-commerce;"+sepp);
   aI("text="+pi+"content management systems;"+sepp);
}
aI(dasher);

aI("image="+domlav+"printcmu.gif;overimage="+domlav+"printcmu_f2.gif;url="+DOM+pc+".php;pageimage="+domlav+"printcmu_f3.gif;pagematch="+DOM+pc+";");

if (url.indexOf(pc) != -1) {
   aI(sub_top);   
   aI("text="+pi+"shelf talkers;url="+DOM+pc+".php#shelftalker;"+sepp+"clickfunction=alert('reloaded');");
   aI("text="+pi+"data conversions;url="+DOM+pc+".php#data;"+sepp+"clickfunction=resize();");
   aI("text="+pi+"online invoicing;url="+DOM+pc+".php#invoicing;"+sepp+"clickfunction=resize();");
}
aI(dasher);

aI("image="+domlav+"projectmanagement.gif;overimage="+domlav+"projectmanagement_f2.gif;url="+DOM+"services/projectmanagement.php;pageimage="+domlav+"projectmanagement_f3.gif;pagematch="+DOM+"services/projectmanagement;");

if (url.indexOf(pm) != -1) {
   aI(sub_top);
   aI("text="+pi+"strategy;url="+DOM+pm+"_strategy.php;"+sepp);
   aI("text="+pi+"development;url="+DOM+pm+"_development.php;"+sepp);
   aI("text="+pi+"management;url="+DOM+pm+"_management.php;"+sepp);
   aI("text="+pi+"promotion;url="+DOM+pm+"_promotion.php;"+sepp);
}

}


Poster: Ruth
Dated: Friday April 2 2004 - 3:41:13 BST

I can't help with this, but just for some info, I check the page,
[maybe for something to do :lol: ]
in various browsers. In ns 4.79 it gives you the click function alert,
and it also gives you pagematch but only on the data and the invoicing ones.
Also, in other browsers, the pagematch works if you click the link
and then hit go, not refresh/reload, as if you were going to the url listed.
Don't know if that's helpful or not.

Ruth


Poster: Andy
Dated: Monday April 5 2004 - 12:59:19 BST

Version 5.11 has a change to the event order so should solve your
problem.

Cheers
Andy


Poster: cubefree
Dated: Friday April 16 2004 - 21:21:35 BST

However, the clickfunction is firing, but then the URL is not being visited, see:

My aI code:

Code: Select all

aI("text="+pi+"weB LOG;url="+DOM+ut+".php#blog;"+sepp+"clickfunction=mm_changeItemProperty();");


My clickfunction:

Code: Select all

function mm_changeItemProperty()
{
   //alert(_itemRef);
   //8 = offcolor, 18 = pagecolor
   
   for (i=0;i<_mi.length;i++) {
      _mi[i][8]  = '#999999';
      _mi[i][18] = '#999999';
   }
   _mi[_itemRef][8] = '#296B11';
   BDMenu(_mi[_itemRef][0]);
}


http://www.cubefree.com/solutions/contentmgmt.php Click on submenu items, they should change location to hashed anchor name, but they don't move anymore.


HOWEVER THIS DOES SOLVE THE PROBLEM:

Code: Select all

function mm_changeItemProperty(hash)
{
   //alert(_itemRef);
   //8 = offcolor, 18 = pagecolor
   
   for (i=0;i<_mi.length;i++) {
      _mi[i][8]  = '#999999';
      _mi[i][18] = '#999999';
   }
   _mi[_itemRef][8] = '#296B11';
   BDMenu(_mi[_itemRef][0]);
   document.location.href = url + '#' + hash;
}


BUT THEN WHY HAVE THE URL ATTRIBUTE IN THIS aI code??

Code: Select all

aI("text="+pi+"weB LOG;url="+DOM+ut+".php#blog;"+sepp+"clickfunction=mm_changeItemProperty('blog');");


Poster: Ruth
Dated: Friday April 16 2004 - 22:30:04 BST

I checked the link and the anchors worked in IE 5.5, NN 6.1, 7.1, Opera 6.05, 7.1. You might list the browser and os in which they are not working.

Ruth