$(window).load(function(){ var $wall = $('#content'); $wall.imagesLoaded( function(){ $wall.masonry({ itemSelector: '#post', columnWidth: 400, isFitWidth: true, isAnimated: !Modernizr.csstransitions //isAnimated: true }); }); $wall.infinitescroll({ navSelector : ".nav", nextSelector : ".nav a", itemSelector : "#post, #time", behavior : 'twitter', extraScrollPx: 50, bufferPx : 5000, loadingImg : "", loadingText : "", donetext : "" }, function( newElements ) { var $newElems = $( newElements ).css({ opacity: 0 }); $newElems.imagesLoaded(function(){ $newElems.animate({ opacity: 1 }); $wall.masonry( "appended", $newElems, true ); }); $('.audio').each(function(){ var audioID = $(this).attr("id"); var $audioPost = $(this); $.ajax({ url: 'http://rayusuzuki.tumblr.com/api/read/json?id=' + audioID, dataType: 'jsonp', timeout: 50000, success: function(data){ $audioPost.find('#audio_player_'+audioID).replaceWith('
' + data.posts[0]['audio-player'].replace("audio_player.swf", "audio_player_black.swf") +'
');} }); }); }); $(document).load(function(){ e.preventDefault(); $wall.infinitescroll('retrieve'); }); $('#load').click(function(){ $(document).trigger('retrieve.infscr'); return false; }); }); //$(window).scroll(function() { // if($(this).scrollTop() != 0) { // $("#tumblr_cntrls").fadeIn();} // else { // $("#tumblr_cntrls").fadeOut();} //}); jQuery(function($){ $("#tweet-feed").tweet({ join_text: "auto", username: "themaxdavis", count: 7, loading_text: "loading tweets..." }); }); $("#caption p").remove(":contains('Source:')"); $("#caption p").remove(":contains('(via')"); $(".social").click(function () { $("#social").slideToggle("slow"); $("#friends").hide("slow"); }); $(".friends").click(function () { $("#friends").slideToggle("slow"); $("#social").hide("slow"); });