-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UX improvements #32
base: master
Are you sure you want to change the base?
UX improvements #32
Conversation
Shorter license, fix `z-index`, get large image `src` from anchor `href`, automatically zoom on mouseover.
Thanks. I appreciate the pull request, and I am considering merging the shorter license and the assumption that the plugin is being assigned to anchor elements whose href is the zoomed image's src. Do you have a reason as to why mouseover would be better than mouseenter? I think mouseenter/mouseleave would be best because they don't trigger additional mouseenter/mouseleave events when mousing over child elements. I don't see why the plugin needs to assign a z-index. If someone wanted to change the layering via z-index, then that can be done at the stylesheet using the class name, instead of through the plugin. I imagine that the majority of the time users will want the z-index to auto because if a z-index was needed, they probably set it to the desired value for the target element. |
While using In case if |
I consider anchor tags with path to big image is bad for Seo. The link will never be visited and it should not be used this way. It is much better to use html5 data- attribute to store preferences about images. |
@tylik1, you are wrong on considering SEO recommendations. It is fine to use image URL in links. With disabled JavaScript it would be accessible in standard way. Most of search engines does not understand JavaScript. It would be preferred to serve for search engines the largest resolution images than small thumbnails for better UX, after search engines can decide if to scale the images. HTML5 |
@laukstein, What age are you living in? Why would one need to disable javascript today? If you need search-engines to find your image, than it's up to you, but I consider it to be wrong to have 2 same images with different size accessbile from one page. |
@tylik1, do you really understand how searching engines work. I agree with you that the best is to serve to crawlers just one unique image (the same with textual articles) and no duplication even if the difference is in size. To restrict searching engines use robots.txt like
Google tries hard to support simple JavaScript's in Googleboot, and it is hard to say if any other search engine boot has any support for JavaScript. If you meant to use HTML/CSS reduced image and zoom the same image up to real size, than it is totally against to SEO and UX recommendations. |
No I didn't I understand that you can use robots.txt, but I don't really see point in it. I already have a medium sized image on a page, and I think it is enough, and as you said there shouldn't be dublicates. A link with larged-sized same image is an overkill for me. Even if search engine uderstands javascript, there is a big difference in putting link with image on a page, and using data- attribute to get the image. |
I agree with you, |
Nice! This is the way to go! |
If you are right, then it is jQuery selector bug. |
There's no bug; |
<<I agree with @Mithgol, but @tylik1 says it does not work for jQuery. .zoomimg [data-img] is the same as .zoomimg *[data-img] if it would solve the jQuery bug. Sorry I thought you wanted to select the element directly containing certain attribute, but if you want to select elements descendants with specified attributes, then it will work fine. |
Shorter license, fix
z-index
, get large imagesrc
from anchorhref
, automatically zoom onmouseover
.Do not forget to update HTML and add
<a href=large-image.jpg ...
.