【发布时间】:2012-06-06 10:23:21
【问题描述】:
谁能帮我解决这个问题?
当我使用最新(或新)版本的 jQuery 时,下面的小脚本可以正常工作。但是,当我使用旧版本的 jQuery 时,我的脚本显示 on 函数不存在。
这是我的脚本,它不适用于旧版本的 jQuery:
$(document).ready(function () {
$(".theImage").on("click", function(){
// In the event clicked, find image, fade slowly to .01 opacity
$(this).find("img").fadeTo("slow", .01).end()
// Then, of siblings, find all images and fade slowly to 100% opacity
.siblings().find("img").fadeTo("slow", 1);
})
})
感谢任何形式的帮助。
【问题讨论】: