From: tommy tomson Date: Tue, 24 Apr 2012 22:19:57 +0000 (+0200) Subject: diabook-themes: small fix X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=08b990a314286d12cd39e4c90a69c2ffd33d10dc;p=friendica.git diabook-themes: small fix --- diff --git a/view/theme/diabook/icons/scroll_bottom.png b/view/theme/diabook/icons/scroll_bottom.png new file mode 100644 index 0000000000..eba301b345 Binary files /dev/null and b/view/theme/diabook/icons/scroll_bottom.png differ diff --git a/view/theme/diabook/nav.tpl b/view/theme/diabook/nav.tpl index e0ffa4f7b0..ce27400f64 100644 --- a/view/theme/diabook/nav.tpl +++ b/view/theme/diabook/nav.tpl @@ -136,7 +136,7 @@ - +
$langselector
diff --git a/view/theme/diabook/theme.php b/view/theme/diabook/theme.php index 269015d0a3..073e270ef9 100755 --- a/view/theme/diabook/theme.php +++ b/view/theme/diabook/theme.php @@ -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"); + } + + }); ';