我有以下代码,这会导致以下错误。如何在悬停时正确使用 JQuery?
编码:
// Hover on the view filters
$('body').on('hover', '#viewfilter', function(event)
{
$('#filterblock').show();
},
function(event)
{
$('#filterblock').hide();
});
没有错误,但显示部分似乎没有触发。
You've tried to add the eventListener to multiple "view filters" using '#viewfilter'
.
This isn't possible because #
is the selector for ID
's.
You can use a className and then call it using '.viewfilters'
. This is probably the issue, but without more code it's impossible to be sure.