2013-06-13 23 views
0

我想在存在两个类中的一个时激活鼠标悬停。现在我有一个名为第一场比赛的课程。传递给鼠标悬停功能中的类

$(document).on('mouseover', 'a.first-game', function(e){ 

现在我想要两个类。我想是这样的:

$(document).on('mouseover', 'a.first-game' || 'a.second-game', function(e){ 

任何帮助,将不胜感激

+0

jQuery的文档提供了所有选择器的列表:http://api.jquery.com/category/selectors/。值得看看它! –

回答

1

您需要使用multiple selector每个选择由,

$(document).on('mouseover', 'a.first-game, a.second-game', function(e){ 

演示分开:Fiddle