January 22, 201115 yr Hi, I've added this cool piece of jQuery to this site (scroll to the bottom and you will see those carbon fiber bars to expand/collapse the divs). It works great, apart from when the expand initiates, it skips the first 30px or so and then skips that same first 30px of the div when it collapses too. It looks really notchy? Does anyone know what I could do to fix this? Also, how do I get them to start collapsed, rather than start expanded? http://www.multitraxpro.co.uk/pt-academy/trainingcourses.html Cheers. Rich Edited January 22, 201115 yr by futureproof
January 22, 201115 yr Try: <div id="cat"> <div class="content"> <p>Blah...</p> </div> </div> Remove padding from #cat in the CSS and add it to #cat .content instead.
January 22, 201115 yr Author Wicked Andy, thanks for that. Do you know how I can start the page with all the divs collapsed?
January 22, 201115 yr HTML: <div id="cat" class="toggleCat"> <div class="content"> <p>Blah...</p> </div> </div> Put into <script> tags in <head> $(document).ready(function(){ $(".toggleCat").css("display", "none"); }); Not 100% sure this will work with that plugin you've got. That plugin seems hugely unnecessary - you can do everything you're using it for with one word of jQuery: .slideToggle()
Create an account or sign in to comment