From: <hv...@ya...> - 2000-10-27 08:41:55
|
Oops, I meant this fix of course. Responded to the wrong mail... Henrik ----- Original Message ----- From: "Pascal Bestebroer" <pa...@dy...> To: <dyn...@li...> Sent: Thursday, October 26, 2000 7:38 PM Subject: RE: [Dynapi-Help] Still problems with inline layers ... > Here's a fix for the inline layers, I'll upload it as patch to sourceforge > as well. > Simply replace the core.ext.inline file with this code: > > > /* > Core DynAPI Distribution > AddOn extensions > */ > DynAPI.findLayers=function(dyndoc,or) { > var divs=[] > or=or||dyndoc > if (is.ns4) divs = dyndoc.doc.layers > if (is.ns5) divs = dyndoc.doc.getElementsByTagName("DIV") > if (is.ie) divs = dyndoc.doc.all.tags("DIV") > for (var i=0; i<divs.length; i++) { > if(DynAPI.isDirectChildOf(divs[i],dyndoc.elm)) { > var id=is.ns4? divs[i].name : divs[i].id > var dlyr=new DynLayer(id) > > dlyr.parent=dyndoc > dlyr.assignElement(divs[i]) > dlyr.dyndoc=or > > if (or.getClass()!=DynDocument) dlyr.isChild=true > else { > DynAPI.removeFromArray(DynAPI.document.all, dlyr, true) > or.all[or.all.length]=dlyr > or.all[dlyr.id]=dlyr > } > > dyndoc.children[dyndoc.children.length]=dlyr > > var index=id.indexOf("Div") > if (index>0) dyndoc.doc.window[id.substr(0,index)] = dyndoc.all[id] > > if (is.ns4) {for (ict in dlyr.doc.images) > dlyr.doc.images[ict].lyrobj=dlyr} > else if (is.ns5) {for (ict in dlyr.doc.images) > dlyr.doc.images[ict].lyrobj=dlyr.elm} > else {for (ict in dlyr.elm.all.tags("img")) > dlyr.elm.all.tags("img")[ict].lyrobj=dlyr} > > if (dlyr.updateValues) dlyr.updateValues() > > DynAPI.findLayers(dlyr,or) > } > } > } > DynLayer.prototype.updateValues=function() { > if (is.ns) { > this.x=parseInt(this.css.left) > this.y=parseInt(this.css.top) > this.w=is.ns4? this.css.clip.width : parseInt(this.css.width) > this.h=is.ns4? this.css.clip.height : parseInt(this.css.height) > if (is.ns4) > this.clip=[this.css.clip.top,this.css.clip.right,this.css.clip.bottom,this.c > ss.clip.left] > this.bgColor = this.doc.bgColor!="this.doc.bgColor"?this.doc.bgColor:null > this.bgImage = this.elm.background.src!=""?this.elm.background.src:null > this.html = this.innerHTML = this.elm.innerHTML = "" > } > else if (is.ie) { > this.x=this.elm.offsetLeft > this.y=this.elm.offsetTop > this.w=is.ie4? this.css.pixelWidth : this.elm.offsetWidth > this.h=is.ie4? this.css.pixelHeight : this.elm.offsetHeight > this.bgImage = this.css.backgroundImage > this.bgColor = this.css.backgroundColor > this.html = this.innerHTML = this.elm.innerHTML > } > this.z = this.css.zIndex > var b = this.css.visibility > this.visible = (b=="inherit"||b=="show"||b=="visible"||b=="") > } > DynAPI.getModel=function() { > dom='DYNAPI OBJECT MODEL:\n\n+DynAPI\n' > for (var i=0; i<DynAPI.documents.length; i++) { > dom+=' +'+DynAPI.documents[i].toString()+'\n' > for (var j=0; j<DynAPI.documents[i].all.length; j++) > dom+='+'+DynAPI.documents[i].all[j].toString()+'\n' > } > alert(dom) > } > DynAPI.isDirectChildOf = function(l, parent) { > if(is.ns) return (l.parentLayer == parent) > for(var p=l.parentElement;p;p=p.parentElement) > if(p.tagName.toLowerCase()=='div') return p==parent > return !parent.tagName > } > > > file://-------------------------------------------------------------------------- > ------------------------------- > > > For those who care: > > There was a problem in the image code, it was resetting the variable i > everytime. > > greets, > > Pascal Bestebroer > pa...@dy... > http://www.dynamic-core.net > > _______________________________________________ > Dynapi-Help mailing list > Dyn...@li... > http://lists.sourceforge.net/mailman/listinfo/dynapi-help __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com |