【发布时间】:2011-04-03 18:37:18
【问题描述】:
我有几个 id 具有以下名称 test1、test2、test3、test4,并且我有以下 jQuery:
jQuery(document).ready(function() {
jQuery('#test').jcarousel({
//something
});
});
我也有以下代码:
jQuery.get(
'allmovieloader.php',
{
first: carousel.first,
last: carousel.last
id: myelementid
},
function(xml) {
mycarousel_itemAddCallback(carousel, carousel.first, carousel.last, xml);
},
'xml'
);
所以当我调用 get 时,我也想传入 id,如 test1、test2、test3 我应该如何更改此 jQuery 代码以使其适用于 test1、test2、test3
【问题讨论】:
-
为什么不给他们一个班级?
-
你不能通过 $('.test') 类来选择它,其中 test 是在为 jcarousel 选择的所有项目上定义的类
标签: jquery