本文实例为大家分享了js仿京东放大镜效果的具体代码,供大家参考,具体内容如下
1、效果1:鼠标经过前
2、效果2:鼠标放上去,弹出右边放大镜
3、效果3:鼠标在小盒子移动,放大镜跟着移动
4、源代码如下:
document *{ margin: 0; padding: 0; } .box1{ position: relative; width: 450px; height: 450px; border: 1px solid #999; margin-left: 80px; margin-top: 50px; } .box1 .img1{ width: 450px; } .box1_bg{ display: none; position: absolute; top: 0; left: 0; width: 300px; height: 300px; background-color: yellow; opacity: .5 ; cursor: move; } .big_img{ display: none; width: 540px; height: 540px; position: absolute; top: 0; left: 470px; border: 1px solid #999; overflow: hidden; } .big_img .big_imgs{ position: absolute; top: 0; left: 0; width: 800px; }
5、喜欢的话记得点赞 收藏 关注噢~
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。



