Tabs and jQuery

Community Forums Forums General Discussion Tabs and jQuery

This topic is: not resolved

This topic contains 2 replies, has 2 voices, and was last updated by  babrees 1 year, 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #39897

    babrees
    Participant
    Post count: 62

    Hi.  I am trying to display info in a custom post type and custom template in tabs, whereby the information is hidden until the tab is clicked.

    I do NOT know jQuery, but searching around the net came up with the following, but I still can’t get it to work!

    http://estateagent.tokrawebdesign.co.uk/property/new-house-new-road-new-town/  (scroll down!)

    in my functions.php file:

    [code]

    // add jQuery
    function add_my_script() {
    wp_enqueue_script(
    'tabs', // name your script so that you can attach other scripts and de-register, etc.
    get_template_directory_uri() . '/js/tabs.js', // this is the location of your script file
    array('jquery') // this array lists the scripts upon which your script depends
    );
    }[/code]

    In my .js file (placed in folder /js/ within my theme

    [code]

    // JavaScript Document
    $(document).ready(function() {
    $("ul.tabs a").click(function() {
    $(".panel div").hide();
    $($(this).attr("href")).show();
    return false;
    });
    })[/code]

    As this doesn’t work does anybody have any suggestions to get it working?

    Thanks

    • This topic was modified 1 year, 5 months ago by  babrees.
    • This topic was modified 1 year, 5 months ago by  babrees.
    • This topic was modified 1 year, 5 months ago by  babrees.
    • This topic was modified 1 year, 5 months ago by  babrees.
    #57579

    Susan
    Moderator
    Post count: 9254

    Hi: I’m working through older, unresolved posts on the forum. As it has been 3 months since you submitted this question, I am hoping your issues has been resolved. Can you please check back in and let me know if that is not the case.


    Susan @ Graphically Designing I offer theme customizations I tweet!
    I’ve taken up the challenge! – help me answer some of the unanswered posts

    #58570

    babrees
    Participant
    Post count: 62

    Hi Susan. Thanks for finding my post! Yes, it was all sorted thanks.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.