WordPress.org

Forums

Tiny Forge
[resolved] Add simple show/hide div ajax (4 posts)

  1. yandoos
    Member
    Posted 1 year ago #

    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

  2. Tomas Mackevicius
    Member
    Theme Author

    Posted 1 year ago #

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

  3. yandoos
    Member
    Posted 1 year ago #

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

    Thanks

  4. Tomas Mackevicius
    Member
    Theme Author

    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.