使用javascript和php在单击图像时将其移动到另一个位置?
所以我有一个带有图像的PHP页面。当点击每个图像时,我希望每个图像都在页面上移动,然后隐藏起来使用javascript和php在单击图像时将其移动到另一个位置?,javascript,php,jquery,html,jquery-animate,Javascript,Php,Jquery,Html,Jquery Animate,所以我有一个带有图像的PHP页面。当点击每个图像时,我希望每个图像都在页面上移动,然后隐藏起来 <div class="lagoon"> <img src="images/lagoon.jpg" alt="lagoon" id="LL"/> <p class="text">Lagoon</p> </div> 我试过这个,还有很多其他方法,请帮忙。你的CSS选择器不正确。使用#以元素的id为目标 $("#LL").click(f
<div class="lagoon">
<img src="images/lagoon.jpg" alt="lagoon" id="LL"/>
<p class="text">Lagoon</p>
</div>
我试过这个,还有很多其他方法,请帮忙。你的CSS选择器不正确。使用#以元素的
id
为目标
$("#LL").click(function (){
$("div").animate({left:'250px'});
});
请考虑查看JQuery手册。
$("#LL").click(function (){
$("div").animate({left:'250px'});
});