jquery - How to move spans with an animation? -
i'm using twitter-bootstrap framework , have 2 span4 centered using offset class. i'm trying doing animation removing offset class , pulling spans right put span4 @ end.
i mean, doing in this fiddle (to see result better enter here) slide animation of 2 first spans right , fadein/fadeout annimation third span.
css
.span4 { background: red; text-align: center; height: 400px; } .hidden{ display:none !important; }
html
<div class="container"> <div id="rowad" class="row-fluid"> <div id="firstspan" class="span4 offset2">hello <button class="btn" id="addspan">add span</button> </div> <div class="span4">stack</div> <div id="spanhiden"class="span4 hidden">stack</div> </div> </div>
js
$(document).ready(function () { $("#addspan").click(function () { var textb = $(this).text(); if (textb == "add span"){ $("#firstspan").removeclass("offset2"); $("#spanhiden").removeclass("hidden"); $(this).text("remove span"); }else{ $("#firstspan").addclass("offset2"); $("#spanhiden").addclass("hidden"); $(this).text("add span"); } }); });
any advice or appreciated. iff need more info, let me know , i'll edit post.
try one,
.span4 { background: red; text-align: center; height: 400px; -webkit-transition: 0.7s ease 0s; -moz-transition: 0.7s ease 0s; -o-transition: 0.7s ease 0s; transition: 0.7s ease 0s; }
Comments
Post a Comment