苹果菜单
Posted hilxj
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了苹果菜单相关的知识,希望对你有一定的参考价值。
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>苹果菜单</title>
<style>
*padding: 0;margin: 0;
inputborder: 1px solid #333
#div1position: absolute;bottom: 0;text-align: center;width: 100%;
#div imgwidth: 64px;
</style>
</head>
<body>
<script>
window.onload=function()
var oDiv =document.getElementById("div1");
var oImg =document.querySelectorAll(‘img‘);
document.onmousemove=function(ev)
var ev =ev||window.event;
for(var i=0;i<oImg.length;i++)
var x =oImg[i].offsetLeft+oImg[i].offsetWidth/2;
var y =oImg[i].offsetTop+oImg[i].offsetHeight/2+ oDiv.offsetTop;
var a =ev.clientX -x;
var b=ev.clientY -y;
var c =Math.sqrt(Math.pow(a,2) +Math.pow(b,2));
var scale =1-c/300;
if(scale < 0.5)
scale = 0.5;
oImg[i].style.width=scale*128 +‘px‘;
oImg[i].style.height=scale*128 +‘px‘;
;
</script>
<div id="div1">
<img src="images/pic1.png" alt="">
<img src="images/pic2.png" alt="">
<img src="images/pic3.png" alt="">
<img src="images/pic4.png" alt="">
<img src="images/pic5.png" alt="">
</div>
</body>
</html>
以上是关于苹果菜单的主要内容,如果未能解决你的问题,请参考以下文章