$(document).ready(function() { // twitter feed (https://github.com/christianvuerings/jquery-lifestream) function feedcallback() { var $tweets = $('.lifestream-twitter'); if (!$tweets.length) return false; // append date to tweets $tweets.each(function(){ var $this = $(this), dateString = new Date($this.data('time')).toLocaleString(), $date = $('').text(' ' + dateString + ' '); $date.addClass('tweet-date'); $this.append($date); }); $('#menu, #dates').removeClass('col-sm-6').addClass('col-sm-4'); setTimeout(function() { $('#latest-news').slideDown(2000); }, 500); } if ($("#latest-news").length) { $("#twitter-stream").lifestream({ classname: "lifestream", feedloaded: feedcallback, limit: 10, list:[ { service: "twitter", user: $("#latest-news").data('twitter-account').replace(/(<([^>]+)>)/ig,""), template: { posted: '{{html tweet}}' } } ] }); } // twitter feed END // program animation var hash = window.location.hash; $(hash + ' + li').addClass('active'); $('#calendar a').click(function() { var target = $(this).attr('href'); $('.active').removeClass('active'); $(target + ' + li').addClass('active'); $('html, body').animate({ scrollTop: $(target).offset().top - 40 }, 800, function() { window.location.hash = target; }); return false; }); // program animation END });