jquery help with if statement
Posted
by phpN00b
on Stack Overflow
See other posts from Stack Overflow
or by phpN00b
Published on 2010-02-08T22:11:02Z
Indexed on
2010/05/09
5:08 UTC
Read the original article
Hit count: 232
jQuery
|if-statement
I'm trying to scale images that have a width greater than 100. I'm using the code below, but it scales images that are even below 100px... What am I doing wrong?
if($(".image-attach-body")) {
if($(".image-attach-body a")) {
$(".image-attach-body a").each(function() {
var width = $("span span img").width();
if(width > 100) {
$("span span img").cjObjectScaler({
destObj: $(".image-attach-body"),
method: "fit",
});
}
});
}
}
© Stack Overflow or respective owner