我有一对 Jquery / Javascript 函数:
var id_testimonials = jQuery.noConflict();
//recusive function to power slider
function ttd_testimonial (elem) {
elem.each (function () {
if(id_testimonials(this).is(':visible')) {
id_testimonials(this).hide(4000, function () {ttd_show (id_testimonials(this)); });
}
});
}
//figure out what to show
function ttd_show (elem) {
container = elem.parent();
if (elem.next().length !== 0) {
next_elem = elem.next();
} else {
next_elem = container('.testimonial_single').first();
}
regen_elems = container('.testimonial_single');
id_testimonials(next_elem).show(4000, function (){ ttd_testimonial(regen_elems); });
}
.hide()
据我所知,火灾的完整功能正确无误。我也能够next_elem
正确选择变量,所以我知道第二个函数正确接收它的参数。
但是,.show()
永远不会触发(或似乎永远不会触发)。这似乎没有任何理由。
我试过了next_elem.show(args)
, 没有效果。next_elem.show()
id_testimonials(next_elem).show()
此外,当我尝试添加.css()
第二个函数时,dom 没有更新,但我可以alert()
正确地对象属性。显然这两件事是相关的,但我无法找出原因。