本希望修改图片大小,结果出现了奇怪的结果;
代码如下
script:
[code="java"]
$(document).ready(function(){
$("#test1").click(function (){
// $("img").animate({
// width: $(this).width() *2,
// height: $(this).height() *2
// });
$("#img1").animate({
width: $(this).width() *2,
height: $(this).height() *2
});
alert($("#img1").html());
});
$("#test2").click(function (){
alert($("img").width()+":"+$("img").height());
});
[/code]
[code="java"]
[/code]
代码运行结果;图片被缩小到1/2;
alert出的html为空。。。。
是什么原理?百思不得其解,望指教