【发布时间】:2014-05-04 10:15:52
【问题描述】:
我有一个按钮和两个 HTML 元素。按下按钮后,我从 j 查询中调用了 animate 函数,开始将第一个元素向右移动,并让两个 HTML 元素被触摸。
如何检测两个 HTML 元素被触摸?
需要帮助。提前致谢。
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("#div1").animate({
left:'250px',
});
});
});
</script>
</head>
<body>
<button>Start Animation</button>
<div id = "div1" style="background:#98bf21;height:100px;width:100px;position:absolute;">
</div>
<div id = "div2" style="background:#98bf21;height:100px;width:100px;position:absolute;left:50%;right:50%">
</div>
</body>
</html>
【问题讨论】:
-
请提供一些代码或 JSFiddle :)
-
先生,我按照您的要求编辑了我的帖子 :) 请看 :)
标签: javascript php jquery html css