私はこのjQueryを持っています:
jQuery(".storyImg").each(
function(){
    if(this.width() > this.height()){
        jQuery(this).addClass("landscape");
    } else if (this.width() < this.height()){
        jQuery(this).addClass("portrait");
    } else {
    }
}
);
機能していないようです。関数内からアラートを発生させることさえできません。それは間違いなく html ファイルに含まれており、クラス .storyImg は間違いなく正しいです。