Fiddle link
当我点击绿色div时,一切都隐藏了,但是绿色的div是生涩的,就像在第一个绿色div旁边的一个生涩的动作.是否可以平滑运输,以便它滑动并占据第一个绿色div旁边的位置?
JS:
$('.green').click(function(){
$('.others').fadeOut();
});
CSS:
.green{ background:green; padding:10px; margin:10px; }
.red{ background:red; padding:10px; margin:10px; }
.blue{ background:blue; padding:10px; margin:10px; }
.green:hover{ cursor:pointer;}
.fade{display:none; opacity:0;}
div{ float:left; }
HTML:
<div class="green"></div> <div class="red others"></div> <div class="blue others"></div> <div class="green"></div> <div class="red others"></div> <div class="blue others"></div>
解决方法
也许你可以用hide()切换你的fadeout()
$('.green').click(function(){
$('.others').hide(300);
});
这是您的fiddle更新.