what the heck?
what the heck?
Hello all,
I'm trying to add some sort of function, or combine two different thing's with jQuery. One is a news ticker, the second is adding the <ul> <li>news item</li></ul> to pull in an RSS feed?
Here's my code below.
- <script type="text/javascript">
$(document).ready(function(){
var first = 0;
var speed = 700;
var pause = 3500;
function removeFirst(){
first = $('ul#listticker li:first').html();
$('ul#listticker li:first')
.animate({opacity: 0}, speed)
.fadeOut('slow', function() {$(this).remove();});
addLast(first);
}
function addLast(first){
last = '<li style="display:none">'+first+'</li>';
$('ul#listticker').append(last)
$('ul#listticker li:last')
.animate({opacity: 1}, speed)
.fadeIn('slow')
}
interval = setInterval(removeFirst, pause);
});
</script>
- <ul id="listticker">
<li> <img src="img/1.png" /> <span class="news-text">NEWS ITEM</span> </li>
<li> <img src="img/2.png" /> <span class="news-text">NEWS ITEM </li>
<li> <img src="img/3.png" /> <span class="news-text">NEWS ITEM</span> </li>
<li> <img src="img/4.png" /> <span class="news-text">NEWS ITEM</span> </li>
</ul>