reactjs - 如何指定位置以在网站上添加下一个注释?
问题描述
如何指定要添加的下一个音符的位置我尝试使用以下代码,但它甚至在上一个音符上随机生成。但下一个音符不应位于上一个音符的位置。
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)' };
},
解决方案
推荐阅读
- clojure - 如何将向量 [1 2 3 :a :b :c :A :B :C] 转换为 [ {:index 1 :lower :a :upper :A} {:index 2 :lower :b :upper :B} { :index 3 :lower :c :upper :C} ]?
- sumo - 获取车辆坐标
- laravel-5 - 如何修复 laravel migrate 收到“Curl 错误(代码 3):
畸形”? - ios - 支持 iPhone 6、6+、XS、XR、XS Max 的启动屏幕背景图像
- python - 用于形状的张量中的值无效:-1879048192
- visual-studio - 我的 LeanFT 试用许可证有效期为 60 天,安装 1 天后立即到期
- windows-10 - 适用于 Linux 的 Windows 子系统错误:0x800703fa 尝试对已标记为删除的注册表项进行非法操作
- java - 如何转换Mysql数据http调用使用Spring云数据流?
- dart - 如何在执行任务时创建进度对话框并在完成任务对话框后关闭?
- python - 将列表元素分配给numpy数组的有效方法