-
Notifications
You must be signed in to change notification settings - Fork 0
/
getrss.js
44 lines (40 loc) · 1.26 KB
/
getrss.js
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
(function($){
$(function(){
var scroll = $(document).scrollTop();
var headerHeight = $('.page-header').outerHeight();
$(window).scroll(function() {
// scrolled is new position just obtained
var scrolled = $(document).scrollTop();
// optionally emulate non-fixed positioning behaviour
if (scrolled > headerHeight){
$('.page-header').addClass('off-canvas');
} else {
$('.page-header').removeClass('off-canvas');
}
if (scrolled > scroll){
// scrolling down
$('.page-header').removeClass('fixed');
} else {
//scrolling up
$('.page-header').addClass('fixed');
}
scroll = $(document).scrollTop();
});
});
})(jQuery);
function showRSS(str) {
if (str.length==0) {
document.getElementById("rssOutput").innerHTML="";
return;
}
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("rssOutput").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","getrss.php?q="+str,true);
xmlhttp.send();
window.scrollTo(0, 0);
document.title = document.getElementById('rssList').options[document.getElementById('rssList').selectedIndex].text;
}