function?sizeAauto(){
????for(var?i?=?0;i?<=$(".img_box").length;i++){
????????($(".img_box").eq(i)).append('<img?src="img/x4.png"?title="放大圖片"?class="img"/>');
????????($(".close").eq(i)).append('<img?src="img/x5.png">');
????????$(document).ready(function(){
????????????var?imgWidth?=??($(".img_box").eq(i)).width();
????????????var?imgHeight?=??($(".img_box").eq(i)).height();
????????????($(".img_bg").eq(i)).css("width",?imgWidth);
????????????($(".img_bg").eq(i)).css("height",?imgHeight);
????????????($(".img_bg").eq(i)).css("line-height",?imgHeight?+?30?+?"px");
????????????$(window).on("resize",?function?()?{
????????????????var?imgWidth?=??($(".img_box").eq(i)).width();
????????????????var?imgHeight?=??($(".img_box").eq(i)).height();
????????????????($(".img_bg").eq(i)).css("width",?imgWidth);
????????????????($(".img_bg").eq(i)).css("height",?imgHeight);
????????????????($(".img_bg").eq(i)).css("line-height",?imgHeight?+?30?+?"px");
????????????????console.log(?imgWidth);
????????????}(i));
????????????$(window).trigger("resize");
????????}(i));
????}加入for循環(huán)后, resize無(wú)效無(wú)法實(shí)時(shí)獲取width和heigh
resize無(wú)效無(wú)法實(shí)時(shí)獲取width和heigh?,求解
怪盜飯團(tuán)
2016-06-01 15:15:48