-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rough-1.html
162 lines (140 loc) · 5.76 KB
/
Rough-1.html
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<!DOCTYPE html>
<html>
<head>
<title>jQuery Ticker</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js "></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script type="text/javascript">
function ticker() {
$('#ListTicker li:first').slideUp(function() {
$(this).appendTo($('#ListTicker')).slideDown();
});
}
setInterval(ticker, 4000);
$(document).ready(function() {
whereMagicHappens()
});
var whereMagicHappens = function() {
var feed = "http://espn.go.com/espn/rss/nfl/news";
$.ajax(feed, {
accepts:{
xml:"application/rss+xml"
},
dataType:"xml",
success:function(data) {
console.log(data)
$(data).find("item").each(function () {
var parsedXML = $(this);
var receivingObject = {};
receivingObject.title = parsedXML.find("title").text();
receivingObject.description = parsedXML.find("description").text();
receivingObject.link = parsedXML.find("link").text();
receivingObject.pubDate = parsedXML.find("pubDate").text();
var newListItem = document.createElement("li");
var newDivItem = document.createElement("div");
var newHeaderItem = document.createElement("customheader");
var newParaItem = document.createElement("p");
//newListItem.textContent =
newHeaderItem.textContent = receivingObject.title;
newParaItem.textContent = receivingObject.pubDate;
newDivItem.appendChild(newHeaderItem);
newDivItem.appendChild(newParaItem);
newListItem.appendChild(newDivItem);
$($("#ListTicker")[0]).append(newListItem);
//var newDescItem = document.createTextNode(receivingObject.pubDate);
//newListItem.appendChild(newDescItem);
//document.getElementById("ListTicker").appendChild(newDescItem);
//$($("#ListTicker")[0]).append(newListItem);
//newListItem.textContent = receivingObject.pubDate;
//var newListItem = document.createElement("li");
//newListItem.textContent = receivingObject.pubDate;
//newListItem.textContent = receivingObject.link;
//$($("#ListTicker")).append(newListItem);
// console.log("------------ Next ------------");
// console.log("title : " + parsedXML.find("title").text());
// console.log("description: " + parsedXML.find("description").text());
//console.log("link : " + parsedXML.find("link").text());
});
// var receivingArray = new receivingArray();
// receivingArray = receivingObject;
// console.log(receivingArray);
}
});
};
</script>
<style>
.ticker {
width: 400px;
height: 495px;
overflow: hidden;
border: 1px solid #DDD;
border-radius: 5px;
box-shadow: 0px 0px 5px #DDD;
background-color: #F5F3E5;
text-align: left;
}
.ticker h3 {
padding: 0 0 10px 10px;
border-bottom: 1px solid #A7A7A7;
}
ul {
list-style: none;
padding: 0;
margin: 0;
/*font-style: italic;*/
}
ul li {
list-style: none;
height: 70px;
padding: 7px;
border-bottom: 1px solid #D6CFB8;
}
customheader {
font-size: 13px;
font-weight: heavy;
color: #2a6496;
font-family: "Cousine";
}
p {
font-size: 13px;
}
body {
/*background-image: url("Tom-Brady-image.png");
background-size:25%;
background-position: right;*/
/*background-image: url("Tom-Snap.png");*/
/*background-image: url("Tom-Brady-image.png");
background-size:50%;*/
/*background-size:25%;*/
/*background-image: url("nfl_logo_2015_gold.jpg");
background-size:15%;*/
/*background-repeat: no-repeat;*/
/*background-position: center;*/
background-image: url("Images/super-bowl-2016.jpg");
background-size:100% 120%;
background-repeat: no-repeat;
/*background-position: center;*/
}
@font-face {
font-family: OctinSports;
src: url("Fonts/good times rg.ttf") /* TTF file for CSS3 browsers */
}
h3 {
font-family: OctinSports;
font-size: 20px;
}
</style>
</head>
<body>
<div class="ticker">
<h3>2<sup>nd</sup> and Goal</h3>
<ul id="ListTicker">
<!-- <li>Box Office: 'Captain America: Civil War' Tops $200M In Just Five Days</li>
<li>Captain America: Civil War Isn't The End Of The Avengers Conflict ...</li>
<li>iPhone 7 Image Leak Delivers Double Bad News Blow</li>
<li>Nikola's sleek hybrid semi could be the Tesla of trucks</li>
<li>Pentagon Turns to Silicon Valley for Edge in Artificial Intelligence</li> -->
</ul>
</div>
</body>
</html>