【发布时间】:2016-03-24 20:42:46
【问题描述】:
我正在尝试在单击 div ITSELF 时使<div> 抖动,但到目前为止,无论我在页面的哪个位置单击,所述<div> 都会抖动。
这是我的代码:
#port-two {
color: white;
background: black;
height: 250px;
margin-bottom: 10px;
display: flex;
flex-direction: column;
justify-content: center;
resize: vertical;
text-align: center;
font-size: 35px !important;
font-family: 'Exo', sans-serif !important;
font-weight: 200 !important;
}
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script>
$(document).click(function() {
$("#port-two").effect("shake");
});
</script>
<div id="port-two" class="me">this is what's supposed to shake WHEN IT ITSELF IS CLICKED. It now shakes no matter where you click :(</div>
【问题讨论】: