summaryrefslogtreecommitdiffstats
path: root/source/javascripts/twitter.js
diff options
context:
space:
mode:
Diffstat (limited to 'source/javascripts/twitter.js')
-rw-r--r--source/javascripts/twitter.js60
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