我正在四处阅读并看到David Walsh的 this example 关于如何使用mootools动画记录删除动画。我不想将mootools添加到项目中只是为了使用这个效果,jquery中存在完全相同的效果吗?
答案 0 :(得分:1)
这些方面应该有效:
<style>
.delete { border:solid 1px; cursor:pointer}
</style>
<div class='delete' id='record-0'>1</div>
<div class='delete' id='record-1'>2</div>
<div class='delete' id='record-2'>3</div>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js'></script>
<script>
$('.delete').click(function() {
$.post("/delete_script",
{"delete":$(this).attr('id').replace('record-', '')},
function(){$(this).slideToggle()})
})
</script>