I have a soft reject, please can someone give me good advice? That is message:
- PROPER EVENT BINDING: Consider using the preferred .on() method rather than .click(), .bind(), .hover(), etc. For best performance and concise code use event delegation whenever possible:
My demo: anismedia.com/toplook
Thanks all!
Yuo should use “on” ready, like this:
$(document).on('ready', function () {
also for this line:
$(window).scroll(function() {
use “on” method.
Maybe there is more, but I see that
1 Like
For example:
$('selector').on( 'click', function() {
// your code
});
Hope that helps!
1 Like
Thank you very much, i will consider that.
One more question, what must i put in " " for function .load and . each?
$(window).on( 'load', function() {
// your code
});
For “.each” you don’t need to use “.on” method. You can check on some of my themes main.js file if you need some more info.
I made it, thank you for helping!
Again Me Can you answer me why i can’t put it in jQuery(document).on(‘ready’, function() {
});
these code:
$(’.nav-toggle’).on(‘click’, function() {
$(this).toggleClass(‘close-nav’);
nav.toggleClass(‘open’);
return false;
});
nav.find(‘a’).on(‘click’, function() {
$(’.nav-toggle’).toggleClass(‘close-nav’);
nav.toggleClass(‘open’);
});
});
Try to change “$” with “jQuery”
1 Like