Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #225472

    TylerRaborn
    Participant

    I am trying to use a simple jQuery script to show and hide content on the page.

    Here is my script:

    jQuery(document).ready(function($) {
    $(‘#fvrooms’).click(function() {
    $(“.fvrooms”).show();
    $(“.fvsuites”).hide();

    });

    $(‘#fvsuites’).click(function() {
    $(“.fvsuites”).show();
    $(“.fvrooms”).hide();

    });
    });

    The Ids are used on buttons and then the content I want to hide and show are given the classes. I have used this same script on a few different sites and they all work fine. But for some reason with your theme this function doesn’t seem to be working.

    Can you give me any advice? Unfortunately I am working on the site locally so I can’t give you a link to look at.

    Thanks!

    #225572

    Rue Nel
    Moderator

    Hello There,

    It seems you got the code mixed up. Please try this revised code if will work on you end.

    jQuery(document).ready(function() {
    jQuery("#fvrooms").click(function() {
    jQuery(".fvrooms").show();
    jQuery(".fvsuites").hide();
    });
    
    jQuery("#fvsuites").click(function() {
    jQuery(".fvsuites").show();
    jQuery(".fvrooms").hide();
    });
    });

    Hope this helps.