html中怎么做扇形菜单,扇形菜单导航load = function() {
var homeEle = document.querySelector(".home");
var imgs = document.querySelectorAll("#wrap > .inner > img");
var flag = true;
var c = 140;
if (flag) {
ansform = "rotate(-720deg)";
for (var i = 0; i < imgs.length; i++) {
imgs[i].ansition = "1s " + (i * 0.1) + "s"
imgs[i].ansform = "rotate(-720deg)";
imgs[i].style.left = -getPoint(c, 90 * i / (imgs.length - 1)).left + "px";
imgs[i].p = -getPoint(c, 90 * i / (imgs.length - 1)).top + "px";
}
} else {
ansform = "rotate(0deg)";
for (var i = 0; i < imgs.length; i++) {
imgs[i].ansition = "1s " + ((imgs.length - 1 - i) * 0.1) + "s";
imgs[i].ansform = "rotate(0deg)"
imgs[i].style.left = 0 + "px";
html如何下载
imgs[i].p = 0 + "px";
}
}
flag = !flag;
}
function getPoint(c, deg) {
var x = und(c * Math.sin(deg * Math.PI / 180));
var y = und(c * s(deg * Math.PI / 180));
return {
left: x,
top: y
};
}
}

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。