admin管理员组文章数量:1026630
What I need is something like this:
$('element1 or element2').mouseover(function()
{
$('element3').show(effects,blah);
});
I hope I just overlooked this possibility in the jQuery docs.
What I need is something like this:
$('element1 or element2').mouseover(function()
{
$('element3').show(effects,blah);
});
I hope I just overlooked this possibility in the jQuery docs.
Share Improve this question edited Feb 10, 2011 at 14:42 R. Martinho Fernandes 235k72 gold badges441 silver badges516 bronze badges asked Feb 10, 2011 at 14:39 roebroeb 4978 silver badges19 bronze badges 03 Answers
Reset to default 5Just use a ma to separate the selectors:
$('element1, element2').mouseover(function()
{
$('element3').show(effects,blah);
});
The ma is the CSS syntax for selector grouping.
You can do it with a ma in the selector, or you can use add
.
$('element1, element2').mouseover(...);
$('element1').add('element2').mouseover(...);
Sure, just as you can specify it in CSS, just use a ma-separated list:
$('.element1, .element2').mouseover(function() {
$('element3').show(effects,blah);
});
What I need is something like this:
$('element1 or element2').mouseover(function()
{
$('element3').show(effects,blah);
});
I hope I just overlooked this possibility in the jQuery docs.
What I need is something like this:
$('element1 or element2').mouseover(function()
{
$('element3').show(effects,blah);
});
I hope I just overlooked this possibility in the jQuery docs.
Share Improve this question edited Feb 10, 2011 at 14:42 R. Martinho Fernandes 235k72 gold badges441 silver badges516 bronze badges asked Feb 10, 2011 at 14:39 roebroeb 4978 silver badges19 bronze badges 03 Answers
Reset to default 5Just use a ma to separate the selectors:
$('element1, element2').mouseover(function()
{
$('element3').show(effects,blah);
});
The ma is the CSS syntax for selector grouping.
You can do it with a ma in the selector, or you can use add
.
$('element1, element2').mouseover(...);
$('element1').add('element2').mouseover(...);
Sure, just as you can specify it in CSS, just use a ma-separated list:
$('.element1, .element2').mouseover(function() {
$('element3').show(effects,blah);
});
本文标签: javascriptHow can I make a disjunction of element selectors with jQueryStack Overflow
版权声明:本文标题:javascript - How can I make a disjunction of element selectors with jQuery? - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745650596a2161294.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论