zoukankan      html  css  js  c++  java
  • 小圆环绕大圆

    function fn(n) {
    return 380 + 100 * Math.sin(n * ((2 * Math.PI) / 7)) - 20;
    };
    function fm(m) {
    return 380 - 100 * Math.cos(m * ((2 * Math.PI) / 7)) - 20;
    };
    function fg(g) {
    div = document.querySelector("#div"+g);
    div.style.position = "absolute";
    div.style.width = "40px";
    div.style.height = "40px"
    div.style.background = "brown";
    div.style.borderRadius = "20px";
    div.style.left = fn(g) + "px"
    div.style.top = fm(g) + "px"
    };
    div = document.querySelector("#div0");
    div.style.position = "absolute";
    div.style.left = "300px";
    div.style.top = "300px";
    div.style.width = "160px";
    div.style.height = "160px"
    div.style.background = "brown";
    div.style.borderRadius = "80px";
    fg(1);fg(2);fg(3);fg(4);fg(5);fg(6);fg(7);

    你好!如果你有什么更好的建议或意见,请在评论区留言。感谢你的阅读!
  • 相关阅读:
    edu_2_4_1
    edu_2_3_2
    edu_2_3_1
    edu_2_2_2
    edu_2_1_1
    edu_2_2_1
    hdu 1270 小希的数表
    hdu 2151 worm
    hdu1089 Ignatius's puzzle
    hdu 2190 悼念512汶川大地震遇难同胞——重建希望小学
  • 原文地址:https://www.cnblogs.com/YCxiaoyang/p/7208474.html
Copyright © 2011-2022 走看看