$("*").click(function(e) {
$(e.target).fadeOut( "slow" );
});
You have to recieve the element clicked on, so put one argument in the function, and call it "e" for element, or what you'd like to call it. Then use e.target to get the div that was clicked on. And then add .fadeOut("slow")
, for the element to fade out slow
But notice. This is on ALL elements in the body. Replace "*", with the id of the div (example: "#id") you want this to happen in.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…