]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/diabook/theme.php
diabook-themes: small fix
[friendica.git] / view / theme / diabook / theme.php
index 269015d0a3e5fa83e90d36d2353129f044f01192..073e270ef9de4803f34b7d2c9945fcd7233ddcfc 100755 (executable)
@@ -356,25 +356,48 @@ $(document).ready(function() {
             $(this).attr("src",newString+"?"+wmode+"&"+oldString);
         }
         else $(this).attr("src",ifr_source+"?"+wmode);
+       
     });
-    
-    $("a[href=#top]").click(function() {
-                       $("html, body").animate({scrollTop:0}, "slow");
-                       return false;
-               });
       
-
 });
 
 function yt_iframe() {
 
-
        $("iframe").load(function() { 
        var ifr_src = $(this).contents().find("body iframe").attr("src");
        $("iframe").contents().find("body iframe").attr("src", ifr_src+"&wmode=transparent");
     });
 
        };
+
+function scrolldown(){
+                       $("html, body").animate({scrollTop:$(document).height()}, "slow");
+                       return false;
+               };
+               
+function scrolltop(){
+                       $("html, body").animate({scrollTop:0}, "slow");
+                       return false;
+               };
+               
+$(window).scroll(function () { 
+               
+                               
+               var scrollInfo = $(window).scrollTop();      
+               
+               if (scrollInfo <= "900"){
+      $("a#top").attr("id","down");
+      $("a#down").attr("onclick","scrolldown()");
+               $("img#scroll_top_bottom").attr("src","view/theme/diabook/icons/scroll_bottom.png");
+               } 
+                   
+      if (scrollInfo > "900"){
+      $("a#down").attr("id","top");
+      $("a#top").attr("onclick","scrolltop()");
+               $("img#scroll_top_bottom").attr("src","view/theme/diabook/icons/scroll_top.png");
+               }
+               
+    });
   
  </script>';