Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to write the script of JS to realize the effect of picture magnifying glass?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "JS to achieve picture magnifying glass effect script how to write", in the daily operation, I believe that many people in JS to achieve picture magnifying glass effect of the script on how to write questions, editor to consult all kinds of information, sort out a simple and easy-to-use method of operation, hope to answer the "JS to achieve picture magnifying glass effect script how to write" doubt! Next, please follow the editor to study!

The complete source code is as follows:

Picture magnifying glass-(yisu.com) * {margin:0px; padding:0px;} # left {width:350px; height:350px; float:left Border:1px solid # cccccc; margin-top:10px; margin-left:10px; position:relative;} # right {border:1px solid # cccccc; float:left Position:relative; width:350px; height:350px; display:none; overflow:hidden; margin-top:10px } # right img {position:absolute;} # small {width:150px; height:150px; background-color:#F90 Border:1px solid # cccccc; opacity:0.3; top:0px; position:absolute; cursor:move; display:none } # left img {width:100%; height:100%;}

$(document) .ready (function (e) {$("# left") .mousemove (move) .mouseenter (function () {$("# small"). Show (); $("# right"). Show ()}) .mouseleave (function () {$("# small"). Hide (); $("# right"). Hide ()})) Function move (e) {var y = e.pageY-$("# left") .offset () .top; if (y > = 75 & & y = 75 & x

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report