你能帮我创建一个编吗 [英] can u help me to create a prog

查看:59
本文介绍了你能帮我创建一个编吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

确定按钮.
当您将鼠标悬停在按钮上时,按钮应该在我做的其他地方次数很多,因此它不应在该地方.

an ok button.
when u take the mouse on button the button should get on other place as many times i do so it should not be on that place.

推荐答案

您好,

我尝试了一些代码,如果您有兴趣,请尝试
Hi,

I tried some code for that Try my if you intersted
<input type ="button" value ="catchme" id="btnmove" onmouseenter="chngplace()" style="height: 26px; width: 77px;left:0px;top:0px;" />



而javascript函数是



And javascript function is

var i=1;
      function chngplace() {

          var l=0;
          var t = 0;
          var str = new String();

          l = document.getElementById("btnmove").style.left.replace('px', '');
          l = parseInt(l) +(parseInt(i)*13);
          t = document.getElementById("btnmove").style.top.replace('px', '');
          t = parseInt(t) + (parseInt(i) * 18);
          i = parseInt(i) + i;
          document.getElementById("btnmove").style.position = 'fixed';
          document.getElementById("btnmove").style.left = l+'px';
          document.getElementById("btnmove").style.top = t+'px';
      }



在这里,我只是向您介绍了如何移动按钮.

您可以更改此代码以实现所需的输出.我们可以生成随机数以在随机位置使用位置按钮

最好的



Here I just gave you idea how we can move buttons.

You can change this code to achieve your desired output.And we can generate random number to use place button in random place

All the Best


这篇关于你能帮我创建一个编吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆