ok well here's the problem.
Our site has a file popBox.js that is used on several different pages.
The pages that reference popBox.js create arrays that are used to put
html content into the layers
on only some of the pages do we need a layer to show up when the page
loads and for the majority of them we don't.
this means that the page that runs this bit must be different on each
page:
(by the way feel free to comment on this bit)
DynAPI.onLoad=function() {
myListener=new EventListener(DynAPI.document)
myListener.onmousedown=function(e) {
if (is.ie4){
ypos=event.y
}
else if (is.ie){
ypos=event.y + document.body.scrollTop
}
else{
ypos=e.getY()
}
}
DynAPI.document.addEventListener(myListener)
contentLayer=new DynLayer()
borderLayer=new DynLayer()
frameLayer=new DynLayer()
//frameLayer -8
contentLayer.setWidth(262)
contentLayer.setBgColor('#ffffff')
contentLayer.moveTo(3,3)
//frameLayer -2
borderLayer.setWidth(268)
borderLayer.setBgColor('#ffffff')
borderLayer.moveTo(1,1)
frameLayer.setWidth(270)
frameLayer.moveTo(-400,0)
frameLayer.setVisible(false)
DynAPI.document.addChild(frameLayer)
frameLayer.addChild(borderLayer)
borderLayer.addChild(contentLayer)
Doug Melvin wrote:
>
> 1) I believe the is an onafterload event (i could be wrog)
> 2) you should put any such code into DynAPI.OnLoad()
> ----- Original Message -----
> From: "Joshua O'Connor-Rose" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, March 20, 2001 10:06 AM
> Subject: [Dynapi-Help] handling onload functions
>
> > I've been using the API for 6 months . . . love it.
> >
> > moving on.
> >
> > I'm having trouble calling a function (makeLayer) that is called when
> > the page loads
> > and references layers also created when the page loads. The trouble is
> > the function is invoked on the page before the
> > layers exist.
> >
> > I tried several varieties of "onload" but none of them have worked so
> > far. (I believe because onload is called by the API
> > before I call the function.)
> >
> > Is there a way I can call a function when the page is done loading.
> > Or ensure that the layers are created before the function call (I
> > thought they were)
> >
> >
> >
> > --
> >
> > from the desk of Whifflebat
> > aka - Joshua O'Connor-Rose
> >
> > -All is Good
> >
> > _______________________________________________
> > Dynapi-Help mailing list
> > [EMAIL PROTECTED]
> > http://lists.sourceforge.net/lists/listinfo/dynapi-help
>
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/dynapi-help
--
from the desk of Whifflebat
aka - Joshua O'Connor-Rose
-All is Good
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help