Skip to content

@dcneiner /jake_the_lab_weather.js secret
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
$(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});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.