功能我有一个代码代码与参数
jQuery(function() {
jQuery(".class1").each(function() {
jQuery(".class2").hide("fast");
jQuery(this).children("input").click(
function() {
if (jQuery(this).parent().hasClass('class3')) {
jQuery(".class2").toggle("slow");
} else {
jQuery(".class2").hide("slow");
}
});
});
});
我怎样才能改变它与参数的Class1,Class2中,CLASS3许多使用可重复使用的功能?
你需要学习如何做一个功能?我不明白 –
只是做一个函数并传递三个_class_作为参数。 – TGrif
我试过做一些使用这样的代码就像一个函数:inputshow('class1','class2','class3'),其中'class1'等将是一个真实的类,例如,上面的代码使用在许多案例。 –