//http://stackoverflow.com/questions/1251300/how-to-run-two-jquery-animations-simultaneously
var expanded = true;
$('div:first').click(function() {
//var num = $('div').length;
//var height = parseInt($('div').css("height")); //height of block
//var border = 1; //border between blocks size
//var total = height*num + border*num; //total we have to translate
if (expanded) {
$('div:not(:first)').slideUp({ duration: 200, queue: false});
//$('div:not(:first)').animate({ bottom: total + 'px'},{duration: 200, queue: false});
expanded = false;
} else {
$('div:not(:first)').slideDown({ duration: 200, queue: false});
//$('div:not(:first)').animate({ top: 0}, 800, function() {});
expanded = true;
}
});
//how to do this with Javascript? you would need to either delay the first command executed to have the effect two events were happening at the same time or multithread
//multithreading for Javascript: https://developer.mozilla.org/en-US/docs/Web/Guide/Performance/Using_web_workers
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.