-2

I have a show/hide functionality for the Video and FAQ section on the following test page: [code]http://63.246.25.145/surety-bonds/contract-bonds/performance_bond.htm[/code]

I believe my code should show 5 FAQs and 3 videos, but it is displaying 3 FAQS and 3 Videos.

What am I missing here?

MichaelW
  • 41
  • 1
  • 1
  • 4

1 Answers1

0

Your are showing 5 'li' elements, but the answers are 'li' elements as well. To display 5 questions, you need to show the first 10 list items.

if(f.children("li").size()<=10)
    return; 
SteveP
  • 18,840
  • 9
  • 47
  • 60
  • Better yet, filter it to items with the class `question` – Dark Falcon Mar 08 '13 at 16:51
  • LOL. I took pity on him :) – SteveP Mar 08 '13 at 16:57
  • Thanks SteveP! That was a dumb move on my part. I don't know JS (obviously), only PHP so this one may have taken forever without you, but is clear now. Much appreciated. – MichaelW Mar 08 '13 at 18:02
  • Dark Falcon, this isn't my code. I'm just modifying someone else's and I don't know JS. Can you clarify your suggestion further for me? Thanks in advance. It is greatly appreciated. – MichaelW Mar 08 '13 at 18:03