diff options
author | SkyArrow <tommy351@gmail.com> | 2012-01-24 18:20:05 +0100 |
---|---|---|
committer | SkyArrow <tommy351@gmail.com> | 2012-01-24 18:20:05 +0100 |
commit | 1599df108116ca573208e4117ace405fdb8be2be (patch) | |
tree | a5d006741b20128dfff8f9e4e905ed3e5ccf5e3c /source/javascripts | |
parent | 106288f71d6ccd4ef7e510705d9099836dd98476 (diff) | |
download | octopress-theme-jeyzu-1599df108116ca573208e4117ace405fdb8be2be.zip octopress-theme-jeyzu-1599df108116ca573208e4117ace405fdb8be2be.tar.gz |
responsive layout
Diffstat (limited to 'source/javascripts')
-rw-r--r-- | source/javascripts/twitter.js | 60 |
1 files changed, 31 insertions, 29 deletions
diff --git a/source/javascripts/twitter.js b/source/javascripts/twitter.js index 5a7b9d5..92fb7b1 100644 --- a/source/javascripts/twitter.js +++ b/source/javascripts/twitter.js @@ -50,39 +50,41 @@ } } - banner.show(); + if ($(window).width() > 600){ + banner.show(); - $.getJSON('http://twitter.com/status/user_timeline/tommy351.json?count=10&callback=?', function(json){ - var length = json.length, - fragment = document.createDocumentFragment(), - counts = 0, - timeout; + $.getJSON('http://twitter.com/status/user_timeline/tommy351.json?count=10&callback=?', function(json){ + var length = json.length, + fragment = document.createDocumentFragment(), + counts = 0, + timeout; - for (var i=0; i<length; i++){ - var item = document.createElement('li'); - item.innerHTML = linkify(json[i].text) + '<small>'+relativeDate(json[i].created_at)+'</small>'; - fragment.appendChild(item); - } + for (var i=0; i<length; i++){ + var item = document.createElement('li'); + item.innerHTML = linkify(json[i].text) + '<small>'+relativeDate(json[i].created_at)+'</small>'; + fragment.appendChild(item); + } - var play = function(){ - timeout = setTimeout(function(){ - feed.animate({top: '-='+30}, speed, function(){ - $(this).append($(this).children().eq(counts).clone()); - counts++; - play(); - }); - }, interval); - } + var play = function(){ + timeout = setTimeout(function(){ + feed.animate({top: '-='+30}, speed, function(){ + $(this).append($(this).children().eq(counts).clone()); + counts++; + play(); + }); + }, interval); + } - var pause = function(){ - clearTimeout(timeout); - } + var pause = function(){ + clearTimeout(timeout); + } - banner.on('mouseenter', pause).on('mouseleave', play) - .children('.loading').hide().end() - .children('.container').show() - .children('.feed').append(fragment); + banner.on('mouseenter', pause).on('mouseleave', play) + .children('.loading').hide().end() + .children('.container').show() + .children('.feed').append(fragment); - play(); - }); + play(); + }); + } })(jQuery);
\ No newline at end of file |