且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jQuery图像映射替代

更新时间:2023-01-26 22:32:46

CSS是使用图像映射时的方式。您可以通过更改左上宽度高度值,轻松地在图像的任何区域放置具有所需宽度和高度的链接。

CSS is the way to go when working with image maps. You can easily position a link with desired width and height over any area of the image by changing top left width height values.

在示例中,将鼠标悬停在婴儿脸上或图像中的红色光线上。要更改锚点的位置,您需要做的是修改#pos1和#pos2的顶部和左侧属性。对于边框的宽度和高度也是如此。所有使用没有javaScript的CSS。

In the example, Hover over the babies face or the red light in the image. To change the position of the anchors all you need to do is modify the top and left properties of #pos1 and #pos2. Same goes for width and height of the bounding box. All done with CSS with no javaScript.