首页 > 解决方案 > 如何指定位置以在网站上添加下一个注释?

问题描述

如何指定要添加的下一个音符的位置我尝试使用以下代码,但它甚至在上一个音符上随机生成。但下一个音符不应位于上一个音符的位置。

 randomBetween: function (min, max) {
                return min + Math.ceil(Math.random() * max);
  },
 componentWillMount: function () {
      this.style = {
      right: this.randomBetween(0, window.innerWidth - 150) + 'px',
      top: this.randomBetween(0, window.innerHeight - 150) + 'px',
      transform: 'rotate(' + this.randomBetween(-15, 15) + 'deg)' };

   },

标签: reactjs

解决方案


推荐阅读