/    Sign up×
Community /Pin to ProfileBookmark

What parameters would I pass to ConstructObject()

I need to edit my current create() function to include the below ConstructObject() and InitialiseScrollableArea(), in order to make my menus scrollable. What parameters would I pass the ConstructObject function?

Here is the call to create: create(document.all[i],tree) where tree is a multilevel array with all the text for the menus.

function InitialiseScrollableArea(){
objContainer=new ConstructObject(‘divContainer’)
objScroller=new ConstructObject(‘divContent’,’divContainer’)
objScroller.MoveArea(0,0)
objContainer.css.visibility=’visible’
initialised=true;
}

function ConstructObject(obj,nest){
nest=(!nest) ? ”:’document.’+nest+’.’
this.el = document.getElementById( obj );
this.css = this.el.style;

this.scrollHeight = this.el.offsetHeight
this.clipHeight = this.el.offsetHeight

this.up = MoveAreaUp;
this.down = MoveAreaDown;
this.MoveArea = MoveArea;
this.x;
this.y;
this.obj = obj + “Object”
eval(this.obj + “=this”)
return this;

}

function _create(e,ary){
var str = new String();
var strNewP
var menuId = _
menus.length;
str = ‘<DIV ID=”_div_
+ menuId
+ ‘” STYLE=”visibility:hidden;position:absolute;top:0;left:0;width:’
+ e.attribs[“width”]
+ ‘;height:10;background-color:black;”>’;
e.insertAdjacentHTML(“AfterEnd”,str);
var thismenu = document.all.item(“_div_” + menuId);
_menus[menuId] = thismenu;
thismenu.menuId = menuId;
thismenu.close = _
close;
thismenu.menuParent = null;
thismenu.menuChild = null;
thismenu.highlightBG = e.attribs[“highlight”];
thismenu.normalBG = e.attribs[“background”];
thismenu.menuOffset = e.attribs[“menu-offset”];
thismenu.menuTopoffset = e.attribs[“menu-topoffset”];
thismenu.waitDelay = e.attribs

for(var i=0;i<ary.length;i++){
str = ‘<SPAN ID=”_link_’
+ menuId
+ ‘_’
+ i
+ ‘” STYLE=”position:absolute;top:’
+ prevBottom
+ ‘;left:0;height:’
+ e.attribs[“height”]
+ ‘;overflow:hidden;width:’
+ e.attribs[“width”]
+ ‘;background:’
+ e.attribs[“background”]
+ ‘;border-width:’
+ e.attribs[“border-width”]
+ ‘;border-style:solid;border-color:’
+ e.attribs[“border-color”]
+ ‘;’;
if(e.attribs[“showrow”]!=true && i != 0){
str +=’border-top-width:0;’;
}
str +=’text-align:left;font-size:’
+ e.attribs[“font-size”]
+ ‘;padding-left:4;”>’;
if(ary[i].icon!=null){
str +='<SPAN STYLE=”font-family:webdings;color:’
+ e.attribs[“icon-color”]
+ ‘”>&#’
+ ary[i].icon
+ ‘;</SPAN> ‘;
}

strNewP =’ ‘;
if(ary[i].url==”http://help.archaio.com”){
strNewP ='” Target=”New”‘;
}
str +='<A HREF=”‘
+ ary[i].url
+ strNewP + ”
+ ‘” TITLE=”‘
+ ary[i].desc
+ ‘” STYLE=”font-family:’
+ e.attribs[“font-family”]
+ ‘;color:’
+ e.attribs[“font-color”]
+ ‘;padding-left:3;”>’
+ ary[i].name
+ ‘</A>’;
if(ary[i].length > 0 && e.attribs[“arrow”]){
str +='<SPAN STYLE=”font-family:webdings;position:absolute;top:0;left:’
+ e.attribs[“arrow-offset”]
+ ‘;width:’
+ (e.attribs[“width”] – e.attribs[“arrow-offset”])
+ ‘;overflow:hidden;color:’
+ e.attribs[“icon-color”]
+ ‘”>&#052;</SPAN>’;
}
str +='</SPAN>’;
thismenu.insertAdjacentHTML(“BeforeEnd”,str);
thisoption = document.all.item(‘_link_’ + menuId + ‘_’ + i);
thisoption.menuId = menuId;
thisoption.onmouseover = _optionmouseover;
thisoption.onmouseout = _optionmouseout;
prevBottom = thisoption.style.pixelTop + (e.attribs[“height”] – e.attribs[“border-width”]);
if(ary[i].length > 0){
thisoption.menuChild=_menus.length;
_create(e,ary[i]);
}
}
thismenu.style.pixelHeight = prevBottom;

}

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @SugarGirl spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...