From: <mi...@pr...> - 2000-12-01 19:57:20
|
Dan, I know that this is just an oversite, or just a coding style that I am unfamiliar with, but on line 50 of dynaimage.js you have a method: /* DynImage.prototype.getImage = function (imgObject) { return this.img; } */ and then on line 61, same method name again, totally different code, but without the 'prototype'... /* DynImage.getImage=function(src) { var img = new Image(); img.src = src; return img; } */ Also, I got a kick out of the alert debug that was left in there on line 38 :-) ... a coding style that I AM very familiar with!! One last question (which is really still the same question repeated): I assume that in the following line of code you responded with was just a change to make to your dynimage.js, in the set Image method, correct? Then, create an "update" method which will dynamically change the image's width and height (this was my original question -- how to do this?), or should the update method be rewriting the IMG tag all together? <!-- <img src=file border=0 onload=update()> --> Thank you (in advance) for your advice, Michael Lilli -- aka: proteanman On Fri, 01 December 2000, Dan Steinman wrote: > > You won't need to write all of this object. I have a DynImage object that inserts 1 image into layer and can easily change it. > > In DynImage I did not yet include auto-resizing to the size of the image, so if you get this working it should be included in DynImage and not as a DynLayer extension (I'd like to move away from having DynLayer do everything because it's not supposed to do everything, only layer management). You can retrieve the size of the image but it must be done after the image has completed loading. > > You write the html with no width/height defined and set the onload handler: > > <img src=file border=0 onload=update()> > > In the handler you should be able to retrieve the image's .width and .height properties correctly and then resize the layer accordingly. > > Dan > > > On Fri, Dec 01, 2000 at 02:48:46AM -0800, mi...@pr... wrote: > > I am working on a simple Dynapi image extension which will be able to manipulate and control images (image swapping, resizing, etc...) > > > > I am able to change an image's src like this... > > > > //DynAPI.document.doc.images['imagenamehere'].src=myimageobject.src > > > > In IE5.5 and NS5 I am able to change an image's width and height like this... > > > > /* > > DynAPI.document.doc.images['imagenamehere'].w=myimageobject.width > > DynAPI.document.doc.images['imagenamehere'].h=myimageobject.height > > */ > > > > Does anyone know if this works in IE4/IE5 (I currently only have IE5.5 installed) and of a way to do this in NS4? > > > > --proteanman > > _______________________________________________ > > Dynapi-Help mailing list > > Dyn...@li... > > http://lists.sourceforge.net/mailman/listinfo/dynapi-help > _______________________________________________ > Dynapi-Help mailing list > Dyn...@li... > http://lists.sourceforge.net/mailman/listinfo/dynapi-help |