0

我在以下元素上有一个点击功能:

$('#make article > a, #latestInner article > a').click(function (e) {...});

现在我想将上面的点击绑定到以下内容:

$('#make article h4 a, #latestInner article h4 a, #models article h4 a').click(function (e) {...});

以便点击:

#make article > a, #latestInner article > a

就像我点击了:

#make article h4 a, #latestInner article h4 a, #models article h4 a
4

3 回答 3

2

jQuerytrigger()会这样做:

$('#make article > a, #latestInner article > a').click(function() {
    $('#make, #latestInner, #models').find('article h4 a').trigger('click');
});
于 2013-03-25T09:16:31.357 回答
1
$('#make article > a, #latestInner article > a').click(function (e) {    
 ("#make article h4 a").trigger('click');    
}
于 2013-03-25T09:16:58.377 回答
0

尝试这个:

$('#make article > a, #latestInner article > a').click(function (e) {
    $('#make article h4 a').click();
    $('#latestInner article h4 a').click();
    $('#models article h4 a').click();
});

$('#make article h4 a, #latestInner article h4 a, #models article h4 a').click(function (e) {...});

希望能帮助到你 :)

于 2013-03-25T09:29:13.393 回答