secret
Created

  • Download Gist
jake_the_lab_weather.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
$(document).ready(function() {
$.YQL = function(query, callback) {
$.getJSON('http://query.yahooapis.com/v1/public/yql?callback=?', { q: query, format: 'json' }, callback);
};
 
$.YQL("select * from rss where url='http://weather.yahooapis.com/forecastrss?p=UKXX0133'", function (data) {
var w = data.query.results.item,
klass = w.condition.text,
encodedclass = klass.replace(/\s+/g, '-').toLowerCase();
$('body').addClass(encodedclass);
});
var weather = $("#weather")
.show()
.delegate('li', 'click', function (e) {
document.body.className = this.className;
e.preventDefault();
}),
menuYloc = weather.position().top;
$(window).scroll(function () {
weather.animate({top: menuYloc + $(document).scrollTop()}, {duration:500, queue: false});
});
});

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.