Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Simple jQuery Accordion Menu - Jerk Problem

    Hi, I'm new here and could do with some help with an accordion script.

    Everything works fine apart from some jerking, not sure if this is normal and I'm being too picky, more noticeable in I.E 8. In firefox you can see the borders vibrate.

    Example: http://www.hungerbusters.co.uk/working/

    JS
    Code:
    // JavaScript Document
    $(document).ready(function() {
    
        //ACCORDION BUTTON ACTION (ON CLICK DO THE FOLLOWING)
        $('.accordionButton').click(function() {
    
            //REMOVE THE ON CLASS FROM ALL BUTTONS
            $('.accordionButton').removeClass('accordionOn');
    
            //NO MATTER WHAT WE CLOSE ALL OPEN SLIDES
            $('.accordionContent').slideUp(1000);
    
            //IF THE NEXT SLIDE WASN'T OPEN THEN OPEN IT
            if($(this).next().is(':hidden') == true) {
    
                //ADD THE ON CLASS TO THE BUTTON TO HIGHLIGHT
                $(this).addClass('accordionOn');
    
                //OPEN THE SLIDE
                $(this).next().slideDown(1000);
             } 
    
         });
    
        /********************************************************************************************************************
        CLOSES ALL S ON PAGE LOAD
        ********************************************************************************************************************/   
        $('.accordionContent').hide();
    
    });
    CSS
    Code:
    @charset "utf-8";
    /* CSS Document */
    
    /* make scrollbar visible */
    html {
    	height:101%;
    }
    
    body {
    	margin:0px !important; 
    	padding:0px !important; 
    }
    
    .clear {
    	clear:both;
    }
    
    #main {
    	width:950px;
    	height:auto;
    	margin:auto;
    	font-family:Arial, Helvetica, sans-serif;
    	font-size:12px;
    }
    
    #social {
    	height:30px;
    	margin:auto;
    	background-color:#5C5A52;
    }
    
    #header {
    	height:100px;
    	background-color:#CBC8B7;
    }
    
    #content {
    	padding:20px;
    	height:auto;
    	background-color:#EDEAD6;
    }
    
    #left {
    	width:580px;
    	float:left;
    }
    
    #right {
    	width:310px;
    	height:600px;
    	float:right;
    	background-color:#C4C0AB;
    }
    
    .category {
    	margin-top:10px;
    }
    
    .category h2 {
    	color:#D34931;
    	background-color:#F7F6ED;
    	line-height:36px;
    	padding-left:10px;
    	margin:0px;
    	height:36px;
    	font-size:18px;
    }
    
    .category .desc {
    	margin-top:10px;
    	border-top:1px dashed #98958A;
    	padding:10px 0px 10px 0px;
    	color:#d34931;
    	font-style:italic;
    }
     
    .accordionButton {
    	padding:10px;
    	border-top:1px dashed #98958A;
    	cursor:pointer;
    }
    
    .accordionButton:hover {
    	background-color:#FFFFFF;
    }
    
    .accordionOn {
    	background-color:#FFF;
    }
    
    .accordionButton h3 {
    	margin:0px;
    	font-size:13px;
    	color:#5c5a53;
    }
    
    .accordionButton .price {
    	font-size:13px;
    	font-weight:bold;
    	color:#D34931;
    	float:right;
    }
    
    .accordionButton .desc {
    	margin:0px;
    	color:#757269;
    }
    
    .accordionContent {
    	padding:10px;
    	background-color:#FFF;
    }
    Any help would be great as this has been frustrating me for 2 days now.

  • #2
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Could a mod please delete this thread, I have now decided not to worry about it.

    Thanks


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •