我所有的 js 脚本都在工作,但这不起作用
$("img").each(function() {
if ($(this).height() > 100) {
return $(this).after("<p class='tasr'>FOTO © TASR</p>");
}
});
当我加载页面时,它不起作用,但是当我复制这个脚本做 chrome-console 时,它工作得很好。
我的咖啡脚本:
jQuery $(document).ready ->
$("img").each ->
if $(this).height() > 100
$(this).after("<p class='tasr'>FOTO © TASR</p>")
编辑:
这是我的脏代码:我来自咖啡脚本的 javascript 代码