English 中文(简体)
j 质量:如果在服务器图像负荷后出现高度变化,如何在方言窗口中达到图像质量高?
原标题:jQuery: how to get height of image div in dialog window if that height changes after image load from server?
  • 时间:2012-01-15 08:03:23
  •  标签:
  • jquery

本条为:

<div id="image-div">
    <img id="image" src="" />
</div>

j 法典:

# on dialog open
$.ajax({
    url: "/ajax/img",
    success: function(data){
        $("#image").prop("src", data);
    }
});

因此,在<代码>#image-div的顶端=0,只有在从服务器上载真实图像之后(在成功要求后)才会改变。 如何达到这一 d新的高度?

感谢!

最佳回答

图像使用负荷活动。 我看到了一些替代解决办法,因为对于带卡的图像load,可能不会火灾。 很抱歉,我从未看到过这一点。 我也见到SO有人说,$ ( #image ).ready (Function(){......});一直为他们工作。

success: function(data){
        $("#image").prop("src", data).load( function() {
               $(this).parent( div ).height();
        });
    }

Ah, 挖掘与探测图像负荷的极端安全途径的联系。

。 准备就绪

问题回答

暂无回答




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

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.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签