From 3277c99787c46cff7e1d5b3b8cc69115b9becf9d Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Fri, 16 Mar 2012 21:28:59 +0100 Subject: [PATCH] Fixed event schedule toggle-button showing wrong if OFF on pageload --- js/functions.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/js/functions.js b/js/functions.js index 628255fecc..181ffcd657 100644 --- a/js/functions.js +++ b/js/functions.js @@ -3060,9 +3060,9 @@ var toggleButton = function ($obj) { // OFF state we need to move it now. if ($('.container', $obj).hasClass('off')) { if (right == 'right') { - $('table, img', $obj).animate({'left': '-=' + move + 'px'}, 0); + $('.container', $obj).animate({'left': '-=' + move + 'px'}, 0); } else { - $('table, img', $obj).animate({'left': '+=' + move + 'px'}, 0); + $('.container', $obj).animate({'left': '+=' + move + 'px'}, 0); } } // Attach an 'onclick' event to the switch @@ -3118,9 +3118,7 @@ var toggleButton = function ($obj) { */ $(window).load(function () { $('.toggleAjax').each(function () { - $(this) - .show() - .find('.toggleButton') + $(this).show(); toggleButton($(this)); }); });