-
Notifications
You must be signed in to change notification settings - Fork 1
/
Default.aspx
127 lines (123 loc) · 3.71 KB
/
Default.aspx
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
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style>
.breaking-news
{
background: #FFF;
border-radius: 1px;
-moz-border-radius: 1px;
-webkit-border-radius: 1px;
box-shadow: 0 1px 3px 0 #B5B5B5;
-moz-box-shadow: 0 1px 3px 0 #b5b5b5;
-webkit-box-shadow: 0 1px 3px 0 #B5B5B5;
width: 1045px;
height: 32px;
margin: 0px auto;
overflow: hidden;
position: relative;
}
.breaking-news span
{
display: block;
float: left;
padding: 0px;
color: #FFF;
font-family: 'Open Sans' ,arial,Georgia, serif;
font-size: 14pt;
}
.breaking-news ul
{
float: left;
margin: 0px;
padding: 0px;
}
.breaking-news ul li
{
display: block;
}
.breaking-news ul a
{
padding: 8px;
display: block;
white-space: nowrap;
text-decoration:none;
color:#000;
}
.breaking-news ul a:hover
{
color:#04a;
}
</style>
<script type="text/javascript" src="jquery-2.0.3.min.js"></script>
<script>
function createTicker() {
var tickerLIs = jQuery(".breaking-news ul").children();
tickerItems = new Array();
tickerLIs.each(function (el) {
tickerItems.push(jQuery(this).html());
});
i = 0;
rotateTicker();
}
function rotateTicker() {
if (i == tickerItems.length) {
i = 0;
}
tickerText = tickerItems[i];
c = 0;
typetext();
setTimeout("rotateTicker()", 5000);
i++;
}
var isInTag = false;
function typetext() {
if (jQuery('.breaking-news ul').length > 0) {
var thisChar = tickerText.substr(c, 1);
if (thisChar == '<') { isInTag = true; }
if (thisChar == '>') { isInTag = false; }
jQuery('.breaking-news ul').html(tickerText.substr(0, c++));
if (c < tickerText.length + 1)
if (isInTag) {
typetext();
} else {
setTimeout("typetext()", 10);
}
else {
c = 1;
tickerText = "";
}
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div class="breaking-news">
<span><a href="https://www.twitter.com/daltinkurt" target="_blank">
<img src="/images/twitter.png" alt="Twitter" /></a></span>
<ul id="ultwits" style="display: none;">
</ul>
<script type="text/javascript">
jQuery(document).ready(function () {
$("#ultwits").empty();
$.ajax({
url: "TwitterHandler.ashx",
type: "GET",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: "{}",
success: function (data) {
$.each(data, function (x, y) {
$("#ultwits").append('<li><a href="' + y.url + '" target="_blank">' + y.text + '</a></li>');
});
$("#ultwits").show();
createTicker();
}
});
});
</script>
</div>
</form>
</body>
</html>