$("#carousel_ul").css("left", "-210px");
}
-// changing the img tag for category view from a source to having a background to make the sizes uniform
+// changing the img tag for category view from a source to having a background to make the sizes uniform
$(".attachment-shop_catalog").each( function () {
- var img_src = $(this).attr("src");
- console.debug(img_src);
- $(this).css("height", 175).css("width", 'auto');
- $(this).css("background", 'url(' + img_src + ') no-repeat center center').css("background-size", "cover");
- $(this).removeAttr("src");
-// $(this).attr("src", "").attr("srcset", "" );
+ $(this).wrap('<div class="image_wrapper"></div>');
});
+ $(".image_wrapper").each( function () {
+ var src = $(this).find('img').attr("src");
+ $(this).css("height", 175).css("width", 'auto');
+ $(this).css("background", 'url(' + src + ') no-repeat center center').css("background-size", "cover");
+ $(this).find('img').remove();
+ });
});
$("#carousel_ul").css("left", "-210px");
}
-// changing the img tag for category view from a source to having a background to make the sizes uniform
+// changing the img tag for category view from a source to having a background to make the sizes uniform
$(".attachment-shop_catalog").each( function () {
- var img_src = $(this).attr("src");
- console.debug(img_src);
- $(this).css("height", 175).css("width", 'auto');
- $(this).css("background", 'url(' + img_src + ') no-repeat center center').css("background-size", "cover");
- $(this).removeAttr("src");
-// $(this).attr("src", "").attr("srcset", "" );
+ $(this).wrap('<div class="image_wrapper"></div>');
});
+ $(".image_wrapper").each( function () {
+ var src = $(this).find('img').attr("src");
+ $(this).css("height", 175).css("width", 'auto');
+ $(this).css("background", 'url(' + src + ') no-repeat center center').css("background-size", "cover");
+ $(this).find('img').remove();
+ });
});