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 7 months, 4 weeks ago.

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

    babrees
    Participant
    Post count: 59

    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:

    
    // 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
     );
     }

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

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

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

    Thanks

    • This topic was modified 11 months, 2 weeks ago by  babrees.
    • This topic was modified 11 months, 2 weeks ago by  babrees.
    • This topic was modified 11 months, 2 weeks ago by  babrees.
    • This topic was modified 11 months, 2 weeks ago by  babrees.
    #57579

    Susan
    Moderator
    Post count: 7418

    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’d love to customize your website! I tweet!
    I’ve taken up the challenge! – help me answer some of the unanswered posts

    #58570

    babrees
    Participant
    Post count: 59

    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.