views:

11

answers:

0

I want to have my bonus bar always toggled so it's non intrusive advertising so that the user clicks on it to bring the bonus bar up. However when it was made it was initally always visible. I want to change this and found I can change by setting slideDown to slideUp however doing this completely breaks the bonuses cycle.

Can anyone point out the problem? site with bonus bar.

  <script>
        var visible = false;

        $(document).ready(function(){

            $("#bonuses-container #bonuses").slideUp("slow", function(){
                $("#bonuses-container #bonuses .carousel").jcarousel({
                    auto:5,
                    scroll:1,
                    animation:500,
                    wrap:"circular",
                    initCallback:initCarousel
                });
                visible = true;
            });

            $("#slots-carousel").jcarousel({
                scroll:1,
                animation:2000,
                initCallback:slotsCallback                    
            });

        });

        $(document).ready(function(){

            $("#tabs-container").tabs({ fx: { opacity: 'toggle' } });

        });

        function initCarousel(carousel){
            $("#bonuses-container .bonuses-btn a").click(function(){
                if(visible)
                    carousel.startAuto();
                else
                carousel.stopAuto();
                visible = !(visible);
                $("#bonuses-container #bonuses").slideToggle("slow");
                return false;
            });
        }

        function slotsCallback(carousel){
            $("p.slots-nav a.left").click(function(){
                carousel.prev();
                return false;
            });
            $("p.slots-nav a.right").click(function(){
                carousel.next();
                return false;
            });
        }
    </script>