/* ドラッグで移動 

$().ready(function() {
	$('#works-web').jqDrag('.jqDrag');
	$('#works-editorial').jqDrag('.jqDrag');
	$('#twitter-slogan').jqDrag('.jqDrag');
	$('#works-iPad-kindle').jqDrag('.jqDrag');
	$('#works-movie').jqDrag('.jqDrag');
	$('#twitter-freepets').jqDrag('.jqDrag');
});*/



/* ブロック要素の高さを揃える 

$(function(){  
    $('#works-web, #works-editorial, #twitter-slogan').flatHeights();  
});
$(function(){  
    $('#works-iPad-kindle, #works-movie, #twitter-freepets').flatHeights();  
});*/




/* jQuery Masonry */

    $(function(){

      var 
        speed = 800,   // animation speed
        $wall = $('#masonry').find('.wrapper')
      ;

      $wall.masonry({
        columnWidth: 160,
        // only apply masonry layout to visible elements
        itemSelector: '.box:not(.invis)',
        animate: true,
        animationOptions: {
          duration: speed,
          queue: false
        }
      });

      $('#filtering-nav a').click(function(){
        var colorClass = '.' + $(this).attr('class');

        if(colorClass=='.all') {
          // show all hidden boxes
          $wall.children('.invis')
            .toggleClass('invis').fadeIn(speed);
        } else {  
          // hide visible boxes 
          $wall.children().not(colorClass).not('.invis')
            .toggleClass('invis').fadeOut(speed);
          // show hidden boxes
          $wall.children(colorClass+'.invis')
            .toggleClass('invis').fadeIn(speed);
        }
        $wall.masonry();

        return false;
      });

    });

