WordPress.org

Support

Support » Themes and Templates » [Resolved] Add simple show/hide div ajax

[Resolved] Add simple show/hide div ajax

  • yandoos
    Participant

    @yandoos

    Can anybody tell me where I can add a short ajax function to toggle show/hide that I can then use on a div on a page please?
    I tried in theme function and it broke the wordpress website until I manually removed it.

    $(function() {
    $(‘#toggle’).click(function() {
    $(‘.toggle’).toggle(‘slow’);
    return false;
    });
    });

    Link <div class=”toggle”>

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Tomas Mackevicius
    Participant

    @tomasm

    This one looks like out of the theme support scope. If nobody will answer, I will close topic in a couple of days.

    yandoos
    Participant

    @yandoos

    Its ok I worked it out. I simply added the jquery to the theme header.

    Thanks

    Theme Author Tomas Mackevicius
    Participant

    @tomasm

    jQuery can be added with a ready to use code in functions.php: section // 5.9 – Add optional meta tags, scripts to head if you use straight Tiny Forge or section 2.2 – Add optional meta tags, scripts to head in Tiny Forge Child theme.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Add simple show/hide div ajax’ is closed to new replies.