sphinx-contrib / images

sphinxcontrib-images extension
Apache License 2.0
17 stars 14 forks source link

change the mouse pointer ? #28

Closed 12rambau closed 1 year ago

12rambau commented 2 years ago

At the moment when I hover an image the mouse pointer change from normal pointer to link pointer. Which according to me is confusing to the end user. Is it possible to customize it to zoom-in ?

jonascj commented 2 years ago

Thank you for your question and possible suggestion for improvement.

If I hover over any of the images (produced by the thumbnail directive) in the documentation https://sphinxcontrib-images.readthedocs.io/en/latest/ I see a change in pointer as you describe, from the normal pointer to the pointer used for links.

That is because the images are wrapped in a anchor/link tag (<a href= ... ></a>). So it is a link the user is hovering over.

As far as I know that is how lightbox works, the library/script/project we use to make image overlay / popup. All the examples and descriptions here https://lokeshdhakar.com/projects/lightbox2/ mention how lightbox works with links to images.

You could write yourself a bit of custom css to change the pointer:

12rambau commented 2 years ago

thanks for the tip I'll see what I can implement in my doc !

jonascj commented 2 years ago

You're welcome.

12rambau commented 2 years ago

for the record, that was as simple as that

/*********************************************************************************
*   change the lightbox cursor
*
**/
a[data-lightbox] {cursor: zoom-in;}
jonascj commented 2 years ago

Reopening: Maybe we should consider changing the pointer. It is a link, but clicking it does not result in navigating to another URL, it results in an overlay showing the enlarged image.