javascript - Fire function after each image is loaded -


I am trying to fill a bid with images and give the size to fit images properly in their size I am The problem is that when the image is not loaded, then the dimension x, y can not be added to the sample from the element. After seeing some examples on stack overflow, I am trying to do this. It does not work ...

  $ .each (data.data.children, function (i, items) {// some images come with busted links. ..if (item.data.url.indexOf (".jpg")> gt; {var imgTitle = item.data.title; imgTitle = imgTitle; $ ('& lt; div id = "C' + i "ATR" ("Class", "IMGDIVI"). Apendo ("#photo"); $ ("& lt; img / & gt;") etter ("src", item data. ("Id", " Picture "+ i) .attr (" class "," pics "). AppendTo (" #c "+ i) .load (function () {$ (this)) Fidin (" slow "); if (iWidth & gt ; IHeight) {$ ('# pic' + i) Wide (270); $ ('# pic' + i). Hight (parseint (270-IMGtital.line / 3thr D "," P "+ i) .appendTo (" #c "+ i); $ (" & lt; p> "+ imgTitle +" & lt; / p & gt; Et ("Class", " Extendo ("#c" + I); var MIMG = "ARTR" $ ('# Pic' +) [0];}});   

Alternate form Is there a way to proportionally fitting proportional fittings inside the padding space?

TIA

DK

 enter image details here

< p> You do not need JavaScript at all. To use the CD, look for this post automatically for a shape in that diva, which is included in it.



Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -