Question

I have 8 or more divs that are displayed in rows of 3 and are inline-block. When you click a div it fades out and the neighboring div moves into it's pace. Is there a way to make the divs slide across rather than just jump?

See here for my JSfiddle http://jsfiddle.net/xmq2x/

and code here:

$( ".box" ).click(function() {
$(this).fadeOut( "slow" );
});
Était-ce utile?

La solution

You can try with Jquery animate() like this:

$( ".box" ).click(function() {
  $(this).animate({
      opacity : '0',
      width : '0'
  },function(){$(this).hide()});
});

An example http://jsfiddle.net/xmq2x/14/

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top