Tutorial on how to achieve magnification effect on jQuery mouse movement pictures

小云云
Release: 2018-01-06 10:39:01
Original
1804 people have browsed it

This article mainly introduces the jQuery mouse movement to achieve the magnification effect on pictures. Friends who need it can refer to it. I hope it can help everyone.

First of all, there must be pictures on the interface. The following is the picture


其次在script代码段中加入如下代码,进行适量修改即可 $(document).ready(function () { var x = 10; var y = 20; $("#big-circle").mouseover(function (e) { var tooTip = "

"; $("body").append(tooTip); $("#tooTip").css({ position: "absolute", 'top': (e.pageY + y) + "px", "left": (e.pageX + x) + "px" }).show("fast"); }).mouseout(function () { $("#tooTip").remove(); }).mousemove(function (e) { $("#tooTip").css({ position: "absolute", 'top': (e.pageY + y) + "px", "left": (e.pageX + x) + "px" }); }); });

Copy after login

Related recommendations:

JS imitation Alipay input input display Digital magnifying glass

JavaScript imitation of Taobao to achieve magnifying glass effect

JS to achieve e-commerce touch enlargement effect

The above is the detailed content of Tutorial on how to achieve magnification effect on jQuery mouse movement pictures. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!