As an aside, I am also trying to get ajax tabs to work together with the "AnyLink Drop Down Menu" script. So far, the closest thing to being sucessful I had was to actually put all of the ajaxtabs.js file code into the menus.js file from AnyLink (ugly solution, but I dont know how to do the equivalent of an include in javascript) and then alter the menus.js code here:
Code:
function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)
if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}
return clickreturnvalue()
//return true;
}
to :
Code:
function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)
if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}
// Hack in ajax tabs?
var admin=new ddajaxtabs("dropmenudiv", "inner")
admin.setpersist(false)
admin.setselectedClassTarget("link") //"link" or "linkparent"
admin.init()
//
return clickreturnvalue()
//return true;
}
which made the script work, however whenever I even hovered over the parent link that spawns the drop down menu, the ajax fetch would happen and whatever page had been loaded into the container div would disappear. I tried moving the admin.init() to several different places but could not find a configuration that did not either destroy my original functionality, or that allowed the new functionality I wanted.
Is there a solution for merging the two scripts that exists already?
Bookmarks