[Resolved] jquery function in static site

Home Forums Support [Resolved] jquery function in static site

Home Forums Support jquery function in static site

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #141893
    Christoph

    Hey,

    I´ve found out, that the more-tag is only working in articles but not in sites – is that right?

    If so, i´d like to use this funktion:

    $('#more').click(function() {
        jQuery(this).text('less about us');
        if($('#extra').is(':visible')){
              jQuery(this).text('Less about us');
        }else{
              jQuery(this).text('More about us');
        }
        $('#extra').slideToggle('fast');
        return false;
    });

    to hide/show html elements

    <a href="#" id="more">More about us</a>
    <div id="extra">ghjjkkhjhg</div>
    #141944
    Tom
    Lead Developer
    Lead Developer

    Where are you wanting to use that function? On your Blog posts?

    #142116
    Christoph

    I´d like to use it in an Impressum page, to toggle an/off the details for “GTC”, “site notice” and “liability”

    #142210
    Tom
    Lead Developer
    Lead Developer

    Perhaps a plugin like this will work for you?: https://wordpress.org/plugins/expander/

    #144516
    Christoph

    Thank you very much!!!
    That was the solution 😉

    #144622
    Tom
    Lead Developer
    Lead Developer

    No problem! 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.