Subversion-Projekte lars-tiefland.shop_ns

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
5 lars 1
 
2
 var headline_count;
3
 var headline_interval;
4
 var old_headline = 0;
5
 var current_headline = 0;
6
 
7
 $(document).ready(function(){
8
   headline_count = $("div.headline").size();
9
 
10
   $("div.headline:eq("+current_headline+")").css('top','5px');
11
 
12
   headline_interval = setInterval(headline_rotate,5000); //time in milliseconds
13
 
14
   /*
15
   $('#scrollup').hover(function() {
16
     clearInterval(headline_interval);
17
   }, function() {
18
     headline_interval = setInterval(headline_rotate,5000); //time in milliseconds
19
     headline_rotate();
20
   });*/
21
 });
22
 
23
 function headline_rotate() {
24
    if(headline_count > 1) {
25
       current_headline = (old_headline + 1) % headline_count;
26
       $("div.headline:eq(" + old_headline + ")").animate({top: -205},"slow", function() {
27
         $(this).css('top','210px');
28
       });
29
       $("div.headline:eq(" + current_headline + ")").show().animate({top: 5},"slow");
30
       old_headline = current_headline;
31
 
32
    }
33
 }