onItemReady does not exist on '#button1'

Hi there,

I’m trying to let a picture fadein when I’m hovering over a button.
I so far got the following code, however, I get receive an error::
“onItemReady does not exist on ‘#button1’”

$w.onReady(function () {
 let fadeOptions = {
 "duration": 250,
 "delay": 0
        };
    $w("#button1").onItemReady(($item, itemData, index)=>{ 
        $item("#image1").onMouseIn((event)=>{
            console.log("mouseIn");
            $item("#image2").show("fade",fadeOptions);
        });
        $item("#image2").onMouseOut((event)=>{ 
            console.log("mouseOut");
            $item("#image2").hide("fade",fadeOptions);
        });
    })
});

Any suggestions what I am missing here?

Kind regards,
Igor

Is “button1” the name of a repeater?

Yes, it is. Because I assumed that you can use buttons as repeaters.

This is basically how it looks like. and underneath that image, there’s another one.

Button is button and repeater is repeater.
They are not the same. They’re competently different things.

@jonatandor35 O.m.g. probably one of the most stupid questions you’ve seen so far :').
But thanks for sure for giving me some directions in this jungle and the extremely fast reply!

You’re welcome.
I suggest you’ll read this:
https://www.wix.com/corvid/reference/$w/repeater/onitemready
and if you have any further questions you can post them here.