I hope you are using jQuery 1.2.6 Try these
$(myImage).width(width); $(myImage).height(width/0.75); On Dec 23, 11:43 pm, Paddy Joy <paddy...@gmail.com> wrote: > Hope someone can help out here, I'm new to jquery and can't figure out > what I have done wrong here. > > The following code works ok in FF and IE, it is a function that > appends an image to a div and sets the width/height of that image. > > function showImage(src,divid,width) > { > var myImage = new Image(); > $(myImage).load(function() > { > $(divid).append(this) > }); > $(myImage).attr("src", src); > $(myImage).attr("width", width); > $(myImage).attr("height", width/0.75); > > } > > I have modified the code so that the image fades in. This works fine > in FF but in IE the image displays at its original dimensions and not > at the dimensions I have set in the code. > > function showImage(src,divid,width) > { > var myImage = new Image(); > $(myImage).load(function() > { > $(this).hide(); > $(divid).append(this) > $(this).fadeIn("fast"); > }); > $(myImage).attr("src", src); > $(myImage).attr("width", width); > $(myImage).attr("height", width/0.75); > > } > > Anyone any ideas? > > Paddy