/    Sign up×
Community /Pin to ProfileBookmark

Help to solve problem: initialization layers in NN4

Can’t initialize internal layer in NN4.There are two layers child_layer and paren_layer.child_layer is within parent_layer. Itry to initialize such way

child_layer.init(parent_layer);

in function init
this.elem=parent_layer.document.layers[‘child_layer’];

child_layer doesn’t want to initialize

What to do?

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@khalidali63May 24.2003 — what do you mean you can't initialize?

are you not able to access the child layer?

My personal experience,I always define div id's in the csssomething like

#parentDiv{

position:absolute;

}

#childDiv{

position:absolute;

}

now you can access them

document.layers.parentDiv.document.layers.childDiv
Copy linkTweet thisAlerts:
@gil_davisMay 24.2003 — First, the layers must exist. Hopefully, you are calling the function init() on load.

Second, you need to specify "document" for it to find the parent layer:this.elem = document.layers['parent_layer'].document.layers[‘child_layer’];
Copy linkTweet thisAlerts:
@kost81authorMay 25.2003 — Of course I spesify parent_layer at first.

I have new thought about origin my problem

Maybe this problem appears because I'm creating my layers at fly by "write"
Copy linkTweet thisAlerts:
@gil_davisMay 25.2003 — post a link
Copy linkTweet thisAlerts:
@kost81authorMay 26.2003 — Project is not in web yet

I'll show piece of code

wind=code(i);
wind_tips[i]=new DHTMLObject(this.id+i);
wind_tips[i].draw(left,top,width,height,fon_scr,0,9,'okno',wind);
wind_tips[i].init();//here I initialize parent_layer

if (can_drag) {

wind_tips[i].dragobj=-1;

head[i]=new DHTMLObject("head"+i);

head[i].init(wind_tips[i].id);//here I initialize child layer

}



function DHTMLObject(id){

this.id=id;

if(!bw.bw) return;

this.name='DHTMLObject_'+this.id;



this.init=function(ns4p){

this.el=bw.dom?document.getElementById(this.id):bw.ie4?document.all[this.id]:bw.ns4?

eval((ns4p?ns4p:'')+"document.layers."+this.id):0;

this.draw=function(x,y,w,h,bg,v,z,css,code){

document.write(bw.ns4?

'<layer id="'+this.id+'" z-index='+z+' left='+x+' top='+y+' width='+w+

' height='+h+(!v?' visibility=hidden':'')+(bg!=""?' bgcolor="'+bg+'"':'')+

(css!=''?' class="'+css+'"':'')+'>'+code+'</layer>':

'<div id="'+this.id+'" style="position:absolute;z-index:'+z+';left:'+x+'px;top:'+y+

'px;width:'+w+'px;'+(!v?'visibility:hidden;':'')+(bg!=""?''+(bw.ns4?'layer-':'')+

'background-color:'+bg+';':'')+'"'+(css!=''?' class="'+css+'"':'')+'>'+code+'</div>');

}

}

something like that
Copy linkTweet thisAlerts:
@gil_davisMay 26.2003 — [b]Project is not in web yet

I'll show piece of code

...

something like that[/b]
[/quote]

I guess you are not too serious about wanting help yet.;-)

This forum gives you the option of attaching files. You can zip up the entire project and attach it to your next post. See "Attach file:" below "Your Reply:".
×

Success!

Help @kost81 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.17,
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,
)...