zoukankan      html  css  js  c++  java
  • jquery 图片放大镜,草稿版

    <!DOCTYPE html>
    <html lang="zh-cn">
    <head>
    	<meta charset="UTF-8">
    	<title>js 放大镜</title>
    	<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
    	<style>
    	*{
    		margin: 0;
    		padding: 0;
    	}
    	.tu{
    		 500px;
    	}
    	.box{
    		border:1px solid #000;
    		 200px;
    		height: 200px;
    	}
    	.box{
    		background:url("https://gdp.alicdn.com/imgextra/i3/3446533752/TB2n3A7fOCYBuNkHFCcXXcHtVXa_!!3446533752.jpg") no-repeat;
    
    	}
    	</style>
    </head>
    <body>
    	
    	<img class="tu" src="https://gdp.alicdn.com/imgextra/i3/3446533752/TB2n3A7fOCYBuNkHFCcXXcHtVXa_!!3446533752.jpg" alt="">
    
    	<div class="box"></div>
    
    
    	<script>
    	$(function(){
    		console.log("1");
    
    		$(".tu").mousemove(function(even){
    			console.log(even)
    			console.log(even.clientX);
    			console.log(even.clientY);
    			$(".box").css("background-position","-"+even.clientX+"px -"+even.clientY+"px")
    		  });
    	})
    
    	</script>
    </body>
    </html>
    

      

  • 相关阅读:
    C语言I博客作业06
    C语言I博客作业05
    C语言I博客作业04
    C语言I博客作业03
    C语言I博客作业02
    第一次作业
    C语言I博客作业09
    C语言I博客作业08
    C语言I博客作业07
    C语言I博客作业06
  • 原文地址:https://www.cnblogs.com/shaozhu520/p/9517730.html
Copyright © 2011-2022 走看看