我有一个图像 - 单击它时会显示两个子 div,然后在鼠标离开时隐藏它们。
这只能连续工作两次,然后在点击时停止执行任何操作。
$('.art').click(function(){
var $this = $(this)
$this.children('.details').children('div').eq(1).show("slide", {direction: "left", easing: "easeOutQuad"}, 200);
$this.children('.details').children('div').eq(0).show("slide", {direction: "right", easing: "easeOutQuad"}, 200);
$this.bind("mouseleave", function(){
$this.children('.details').children('div').eq(0).hide("slide", {direction: "left", easing: "easeOutQuad"}, 200);
$this.children('.details').children('div').eq(1).hide("slide", {direction: "right", easing: "easeOutQuad"}, 200);
})
});