Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Simon Daron
panikweb
Commits
aafb67fd
Commit
aafb67fd
authored
Sep 24, 2013
by
fred
Browse files
move ticker code to init(), so it works after page changes
parent
77641ac8
Changes
2
Show whitespace changes
Inline
Side-by-side
panikweb_templates/static/js/specifics.js
View file @
aafb67fd
...
...
@@ -145,6 +145,7 @@ $(function() {
var
timer
=
null
,
interval
=
5000
;
var
ticker_interval
=
null
;
/*
//TODO: mini icon version for player, (playpause only)
$('#togglePlayer').on('click',function(e) {
...
...
@@ -369,6 +370,22 @@ $(function() {
if
(
$
(
'
input#id_q
'
).
val
()
==
''
)
{
$
(
'
input#id_q
'
).
focus
();
}
$
(
'
#ticker li:not(:first)
'
);
if
(
ticker_interval
)
clearInterval
(
ticker_interval
);
function
tick
(){
$
(
'
#ticker li:first
'
).
animate
({
'
opacity
'
:
0
},
200
,
function
()
{
$
(
this
).
appendTo
(
$
(
'
#ticker
'
)).
css
(
'
opacity
'
,
1
);
});
}
$
(
"
#roller button
"
).
on
(
'
click
'
,
function
(
e
){
clearInterval
(
ticker_interval
);
e
.
preventDefault
();
$
(
$
(
this
).
attr
(
'
data-about
'
)).
prependTo
(
'
#ticker
'
);
return
false
;
});
ticker_interval
=
setInterval
(
function
(){
tick
();
},
20000
);
/**/
}
init
();
});
panikweb_templates/templates/news/roll.html
View file @
aafb67fd
...
...
@@ -32,23 +32,5 @@
</ul>
<style>
</style>
<script>
$
(
function
()
{
$
(
'
#ticker li:not(:first)
'
);
var
ticker_interval
;
function
tick
(){
$
(
'
#ticker li:first
'
).
animate
({
'
opacity
'
:
0
},
200
,
function
()
{
$
(
this
).
appendTo
(
$
(
'
#ticker
'
)).
css
(
'
opacity
'
,
1
);
});
}
$
(
"
#roller button
"
).
on
(
'
click
'
,
function
(
e
){
clearInterval
(
ticker_interval
);
e
.
preventDefault
();
$
(
$
(
this
).
attr
(
'
data-about
'
)).
prependTo
(
'
#ticker
'
);
return
false
;
});
ticker_interval
=
setInterval
(
function
(){
tick
();
},
20000
);
/**/
});
</script>
</div>
</div>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment