AdamRisberg / react-image-magnifiers

A collection of responsive, image magnifying React components for mouse and touch.
MIT License
347 stars 60 forks source link

Cursor Style Not Change to Zoom-In When Image Displayed Asyncronously #48

Closed teknosains closed 3 years ago

teknosains commented 3 years ago

I load the image asyncronously / depends on a trigger. When I hover the image, the cursor is still os-default cursor not the zoom-in.

It will become zoom-in if i click the image first,

is there any workaround for this?

teknosains commented 3 years ago

Solved it by

adding css style

.magnify:hover{
  cursor: zoom-in!important;
}

.magnify > div > img:hover {
  cursor: zoom-in!important;
}

<Magnifier className="magnify" />