English 中文(简体)
图像后面的 Run格图像变压器
原标题:Run jquery image resizer after image is appended
问题回答

电话kepresize后附上了图像。

如果你能够积极评估许多图像,那么,或许在预估之前就将每个图像转播。

var img = $( <img src="pathtofile"/> ).kepresize({maxWidth: 200,maxHeight: 150});
$( #content ).append(img);

最简单的做法是,每次你给人力部增加形象时,都要 call。

我不知道kepresize是否是多余的,但如果是,你可以简单地把它放在所有<代码>上。 IMGs 添加新的内容。 否则,将创建和增补以下网站:

var newImage = $( <img src="pathtofile"/> );
newImage.kepresize({maxWidth: 200,maxHeight: 150});
$( #content ).append(newImage);

发生这种情况的原因是,你试图使那些在人力部之外的东西化为乌有!

在转播职能之前,必须叫 app!

你们的法典必须考虑这一点:

<DEMO:rel=“nofollow noreferer”>http://jsbin.com/eraqo/2

$(function(){
  // this resize when page load the first time
 $( .thumb ).kepresize({maxWidth: 100,maxHeight: 150});  
//this append the image on click event
  $( a#add ).click(function () {
  $( #resizer ).append( <img class="thumb" src="goodphotography.jpg" /> );
//now you can resize the new image
    $( .thumb ).kepresize({maxWidth: 100,maxHeight: 150});
  });
  });

Use .load() event.
Description: Bind an event handler to the "load" JavaScript event.

$( img ).load(function(){
    $(this).kepresize({maxWidth: 200,maxHeight: 150});
});




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签