From 08b990a314286d12cd39e4c90a69c2ffd33d10dc Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Wed, 25 Apr 2012 00:19:57 +0200 Subject: [PATCH] diabook-themes: small fix --- view/theme/diabook/icons/scroll_bottom.png | Bin 0 -> 444 bytes view/theme/diabook/nav.tpl | 2 +- view/theme/diabook/theme.php | 37 +++++++++++++++++---- 3 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 view/theme/diabook/icons/scroll_bottom.png diff --git a/view/theme/diabook/icons/scroll_bottom.png b/view/theme/diabook/icons/scroll_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..eba301b3457b9679caf52e9f3730c11b68999c41 GIT binary patch literal 444 zcmV;t0YmPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyc0 z6eBQ7TH_@E00BHnL_t(Y$F-JWafC1sg}=oBb-+15!da*TBv1!Ps07ZzN$6AoQw1l1 zI(YpP7@8qrxr5B?4+zOel6`MulJGV&tAV%aS<<(Au%u)FCC~t0fD$nPEl_6X%0OCR z%mCsTfzAyItGMp~tgW!jf&yfC0g{Bpp!)%k8MX=vXQG3n`v(eJHl6?yP)VW)S^mD% zM@9;^45xxVW*u$lWR8^#^{nV236q4G$tiA&oWg4>mm=88+3iwz&gO_#Z1mr9hadIb zwqRGU7BarrZOn1?W>1rWG>-B0^s&d^>J>=sarLD$w9Yb6M-Y#j^v_t(5Wd~x@>OiA z-HsCAh4iU1F&t>7k7Z3dtMH9+@}x@n@Zw79J(rX22}qy14Q(mD0zSiE=C-MyvMUwl my+E2-1ze)nzmk4D - +
$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"); + } + + }); ';