console errors

Sobsna all on the screen. Code:

$('.news-block_main').hover( function(){$('.news-block-hover_main').show('fast')('display','block');}, function(){$('.news-block-hover_main').hide('fast')('display','none');} ); 

The code itself works, confusing only errors in the console.

  • 2
    As far as I can see, for some reason, extra brackets are written after the show / hide function calls, remove them and there will be no errors, I mean ('display','block') - Grundy
  • one
    No, 'display','block' must also be removed. - Nofate
  • If you remove the brackets - the code stops functioning - stoner
  • @nofate - thanks, it helped. - stoner

1 answer 1

The show and hide functions return a jQuery object , so the result of calling these functions cannot be used as a function.

Simply remove obscure lines.

 ('display','block') ('display','none') 

and it will work

 $('.news-block_main').hover( function(){$('.news-block-hover_main').show('fast');}, function(){$('.news-block-hover_main').hide('fast');} );