Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Div Click SlideToggle

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #32755
    Waffle
    Member

    Basically.. I cant get one of these slidetoggles working.. when they are working on other pages.. but the Div is the click function.. and its a bit annoying.

    $(document).ready(function(){

    $(".Answer").hide();
    $(".FAQContent").hide();
    $(".FAQContent").slideDown();

    });

    $('.FAQ-Q').click(function(){

    $(".Answer").slideDown();
    });
    #75988
    jamygolden
    Member

    The click event isn’t within the $(document).ready, try this:

    $(document).ready(function(){
    $(".Answer").hide();
    $('.FAQ-Q').click(function(){
    $(".Answer").slideToggle();
    });
    });
    #75991
    Waffle
    Member

    Cheers. That works.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.