• Hi all,

    this my jQuery fonction in the file customs.js :

    jQuery(document).ready(function($) {
    	var img = new Image();
    	var images = ['header-box-bck-1.png', 'header-box-bck-2.png', 'header-box-bck-3.png', 'header-box-bck-4.png', 'header-box-bck-5.png', 'header-box-bck-6.png',];
        img.src = 'my_URL/' + images[Math.floor(Math.random() * images.length)] + '';
    
    	$(img).one('load',function(e) {
    		$('.background').html(img);
    		$('.background img').fadeIn(3000);
    	});
    
    	if(img.complete) img.trigger('load');
     });

    and I make an wp_enqueue_script of customs.js in my functions.php, I load correctly my script but I have this on my console : ReferenceError: Can’t find variable: jQuery.

    Maybe an idea ?
    tks for your help !

The topic ‘ReferenceError: Can't find variable: jQuery’ is closed to new replies.