From c99d72ff553469ce3999d0aa8a206577d389dc58 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sat, 11 Jul 2009 19:14:29 +0000 Subject: [PATCH] add functions for scrolling up and down in vertical themes (addresses #46) --- scripts/ourhandlers.js | 53 ++++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/scripts/ourhandlers.js b/scripts/ourhandlers.js index e72fddc..19bc811 100644 --- a/scripts/ourhandlers.js +++ b/scripts/ourhandlers.js @@ -1,7 +1,7 @@ /* * Image scrolling JQuery code. * -* Copyright (c) 2007, 2008 Jan Dittberner +* Copyright (c) 2007, 2008, 2009 Jan Dittberner * Jan Dittberner IT-Consulting & -Solutions * Cottbuser Str. 1, D-01129 Dresden * @@ -65,22 +65,41 @@ function updateContentImage(pathParts) { } $(document).ready(function() { - $("#arrleft").mouseover(function() { - $("#scrollable").animate({ - left: "0px" - }, 500); - }).mouseout(function() { - $("#scrollable").stop(); - }); - $("#arrright").mouseover(function() { - offset = parseInt($("#imgscroller").css("width")) - - parseInt($("#scrollable").css("width")); - $("#scrollable").animate({ - left: offset + "px" - }, 500); - }).mouseout(function() { - $("#scrollable").stop(); - }); + if (themetype == 'horizontal') { + $("#arrleft").mouseover(function() { + $("#scrollable").animate({ + left: "0px" + }, 500); + }).mouseout(function() { + $("#scrollable").stop(); + }); + $("#arrright").mouseover(function() { + offset = parseInt($("#imgscroller").css("width")) - + parseInt($("#scrollable").css("width")); + $("#scrollable").animate({ + left: offset + "px" + }, 500); + }).mouseout(function() { + $("#scrollable").stop(); + }); + } else { + $('#arrup').mouseover(function() { + $('#scrollable').animate({ + top: "0px" + }, 500); + }).mouseout(function() { + $('#scrollable').stop(); + }); + $('#arrdown').mouseover(function() { + offset = parseInt($('#imgscroller').css('height')) - + parseInt($('#scrollable').css('height')); + $('#scrollable').animate({ + top: offset + "px" + }, 500); + }).mouseout(function() { + $('#scrollable').stop(); + }); + } $("#backbtn").click(function() { $("div.thumbnail img").each(function(i) { var curparts = getPathParts($("img#contentimg").attr("src"));